Fix null reference when no JVM was found
This commit is contained in:
@@ -76,6 +76,9 @@ export function findJvm(javaHome?: string) : Promise<JVM | null> {
|
|||||||
*/
|
*/
|
||||||
export function findJdk(javaHome?: string) : Promise<JVM | null> {
|
export function findJdk(javaHome?: string) : Promise<JVM | null> {
|
||||||
return findJvm(javaHome).then(jvm => {
|
return findJvm(javaHome).then(jvm => {
|
||||||
|
if(!jvm) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (!jvm.isJdk()) {
|
if (!jvm.isJdk()) {
|
||||||
console.log("found jvm is not a JDK");
|
console.log("found jvm is not a JDK");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user