From 00d4f39a6693dc7bbf1d39a680a3a669e557b3fa Mon Sep 17 00:00:00 2001 From: John Cortell Date: Thu, 20 May 2010 22:00:21 +0000 Subject: [PATCH] Bug 313821: Intermittent NPE during shutdown, in source-not-found handling --- .../ui/sourcelookup/CSourceNotFoundEditorInput.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditorInput.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditorInput.java index b2f5777aff3..9ab04724ced 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditorInput.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/sourcelookup/CSourceNotFoundEditorInput.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006 Nokia and others. + * Copyright (c) 2006, 2010 Nokia and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -22,8 +22,9 @@ public class CSourceNotFoundEditorInput extends CommonSourceNotFoundEditorInput @Override public String getName() { - if (getArtifact() instanceof CSourceNotFoundElement) { - String description = ((CSourceNotFoundElement)getArtifact()).getDescription(); + Object artifact = getArtifact(); + if (artifact instanceof CSourceNotFoundElement) { + String description = ((CSourceNotFoundElement)artifact).getDescription(); if (description != null) { return description; }