Skip to content

Commit be5a92e

Browse files
committed
Fix NPE in MinimalState when project VM install is null
JavaRuntime.getVMInstall() can return null during project setup. The null was passed to ExecutionEnvironment.isStrictlyCompatible() which uses ConcurrentHashMap.containsKey(null), causing NPE. This crashed the Plug-in Manifest Builder, leaving workspace projects in inconsistent state and causing cascading test failures in ProjectSmartImportTest.
1 parent 4c26dd3 commit be5a92e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/MinimalState.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ private Map<String, String> loadWorkspaceBundleManifest(File bundleLocation, IRe
162162
return manifest;
163163
}
164164
IVMInstall projectVmInstall = JavaRuntime.getVMInstall(javaProject);
165+
if (projectVmInstall == null) {
166+
PDECore.log(Status.warning("Could not determine VM install for project " //$NON-NLS-1$
167+
+ resource.getProject().getName() + ", skipping BREE injection")); //$NON-NLS-1$
168+
return manifest;
169+
}
165170

166171
IExecutionEnvironment executionEnvironment = Arrays
167172
.stream(JavaRuntime.getExecutionEnvironmentsManager().getExecutionEnvironments())

0 commit comments

Comments
 (0)