Fix null reference when no JVM was found

This commit is contained in:
Tobias Friemel
2020-05-25 00:39:13 +02:00
parent e87dee6954
commit 0bcee72289

View File

@@ -76,6 +76,9 @@ export function findJvm(javaHome?: string) : Promise<JVM | null> {
*/
export function findJdk(javaHome?: string) : Promise<JVM | null> {
return findJvm(javaHome).then(jvm => {
if(!jvm) {
return null;
}
if (!jvm.isJdk()) {
console.log("found jvm is not a JDK");