fixed NPE if DE were to fail to load a symbol file.
authorwpaul
Wed, 03 Jun 2009 16:37:48 -0500
changeset 201 42aa6ce7b5d0
parent 200 08d645f6399f
child 202 4eeba852ae0b
fixed NPE if DE were to fail to load a symbol file.
debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/ui/executables/CarbideSourceFilesProvider.java
--- a/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/ui/executables/CarbideSourceFilesProvider.java	Wed Jun 03 16:37:17 2009 -0500
+++ b/debuggercdi/com.nokia.cdt.debug.cw.symbian/src/com/nokia/cdt/debug/cw/symbian/ui/executables/CarbideSourceFilesProvider.java	Wed Jun 03 16:37:48 2009 -0500
@@ -16,8 +16,6 @@
 */
 package com.nokia.cdt.debug.cw.symbian.ui.executables;
 
-import java.util.ArrayList;
-
 import org.eclipse.cdt.debug.core.executables.Executable;
 import org.eclipse.cdt.debug.core.executables.ISourceFilesProvider;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -29,13 +27,14 @@
 public class CarbideSourceFilesProvider extends PlatformObject implements
 		ISourceFilesProvider {
 
-	public String[] getSourceFiles(Executable executable,
-			IProgressMonitor monitor) {	
-		ArrayList<String> sourceFiles = new ArrayList<String>();
+	public String[] getSourceFiles(Executable executable, IProgressMonitor monitor) {	
 		ISymbolFile symFile = SymbolReaderManager.getSymbolReaderManager().openSymbolFile(executable.getPath().toOSString());
-		String[] sourceArray = symFile.getSourceFiles();
-		symFile.close();
-		return sourceArray;
+		if (symFile != null) {
+			String[] sourceArray = symFile.getSourceFiles();
+			symFile.close();
+			return sourceArray;
+		}
+		return new String[0];
 	}
 
 	public int getPriority(Executable executable) {