Skip to content

Commit 2d633fc

Browse files
Merge pull request #468 from tfriem/master
Fix null reference when no JVM was found
2 parents e87dee6 + 0bcee72 commit 2d633fc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

nodejs-packages/jvm-launch-utils/src/jvm-util.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ export function findJvm(javaHome?: string) : Promise<JVM | null> {
7676
*/
7777
export function findJdk(javaHome?: string) : Promise<JVM | null> {
7878
return findJvm(javaHome).then(jvm => {
79+
if(!jvm) {
80+
return null;
81+
}
7982
if (!jvm.isJdk()) {
8083
console.log("found jvm is not a JDK");
8184

0 commit comments

Comments
 (0)