summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshmi Shanmugam <lshanmugam>2011-05-02 09:51:24 +0000
committerLakshmi Shanmugam <lshanmugam>2011-05-02 09:51:24 +0000
commit20371ac7bc24ef2dc90368b442c30700f28226f0 (patch)
treebf8c0b3b6a06ea9e368fc4abc1b4e125746f7685
parentb9cbee7b913728a6d3d4cef0fbbe2148825051f0 (diff)
downloadeclipse.platform.swt-20371ac7bc24ef2dc90368b442c30700f28226f0.tar.gz
eclipse.platform.swt-20371ac7bc24ef2dc90368b442c30700f28226f0.tar.xz
eclipse.platform.swt-20371ac7bc24ef2dc90368b442c30700f28226f0.zip
Bug 338127-Error NPE (in Program.getProgram())
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java b/bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java
index 7b25ea58be..7adea01242 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Program/cocoa/org/eclipse/swt/program/Program.java
@@ -160,12 +160,13 @@ static Program getProgram(NSBundle bundle) {
bundleName = bundle.objectForInfoDictionaryKey(CFBundleName);
}
if (bundleName == null) {
- bundleName = fullPath.lastPathComponent().stringByDeletingPathExtension();
+ if (fullPath == null) return null;
+ bundleName = fullPath.lastPathComponent().stringByDeletingPathExtension();
}
NSString name = new NSString(bundleName.id);
Program program = new Program();
program.name = name.getString();
- program.fullPath = fullPath.getString();
+ if (fullPath != null) program.fullPath = fullPath.getString();
program.identifier = identifier != null ? identifier.getString() : "";
return program;
}
@@ -195,7 +196,10 @@ public static Program [] getPrograms () {
NSString fullPath = path.stringByAppendingPathComponent(new NSString(id.id));
if (workspace.isFilePackageAtPath(fullPath)) {
NSBundle bundle = NSBundle.bundleWithPath(fullPath);
- if (bundle != null) vector.addElement(getProgram(bundle));
+ if (bundle != null) {
+ Program program = getProgram(bundle);
+ if (program != null) vector.addElement(program);
+ }
}
}
}