IDEA-166892 NullPointerException on startup

Added checks and nullables to handle customized IDEA installations
This commit is contained in:
Alexey Ushakov
2017-01-24 15:12:09 +03:00
parent 1b8ac47958
commit 29a160ec35
2 changed files with 3 additions and 1 deletions
@@ -98,7 +98,7 @@ public class SystemHealthMonitor extends ApplicationComponent.Adapter {
}
else if (SystemInfo.isWindows || SystemInfo.isLinux) {
JdkBundle bundledJdk = JdkBundle.createBundle(bundledJDKAbsoluteLocation, false, false);
if (bundledJdk.getVersion() != null) {
if (bundledJdk != null && bundledJdk.getVersion() != null) {
showSwitchOption = true; // Version of bundled jdk is available, so the jdk is compatible with underlying OS
}
}
@@ -63,10 +63,12 @@ public class JdkBundle {
myBundled = bundled;
}
@Nullable
public static JdkBundle createBundle(@NotNull File jvm, boolean boot, boolean bundled) {
return createBundle(jvm, boot, bundled, true);
}
@Nullable
public static JdkBundle createBundle(@NotNull File jvm, boolean boot, boolean bundled, boolean matchArch) {
String homeSubPath = SystemInfo.isMac ? "Contents/Home" : "";
return createBundle(jvm, homeSubPath, boot, bundled, matchArch);