Skip to content

Commit

Permalink
Possible fix for #196 - npe when launching rsp
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <[email protected]>
  • Loading branch information
robstryker committed May 22, 2023
1 parent 45ac3ae commit 982ac95
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vscode/src/impl/requirements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,18 @@ export async function resolveRequirements(minJavaVersion: number): Promise<Requi

export async function resolveRequirementsImpl(minJavaVersion: number): Promise<RequirementsResult> {
const javaHome: string | RspRequirementsRejection = await checkJavaRuntime();
if( !javaHome ) {
return {rejection: getRejectionWithDownloadUrl('Unexpected Error: Java Home could not be located')};
}
if( (javaHome as any).rspReqReject) {
return {rejection: javaHome as RspRequirementsRejection};
}
const javaHome2: string = javaHome as string;
const javaVersion: number | RspRequirementsRejection = await checkJavaVersion(javaHome2, minJavaVersion);
if( !javaVersion ) {
return {rejection: getRejectionWithDownloadUrl('Unexpected Error: Java Version could not be discovered for java home ' + javaHome2)};
}

if( (javaVersion as any).rspReqReject) {
return {rejection: javaVersion as RspRequirementsRejection};
}
Expand Down

0 comments on commit 982ac95

Please sign in to comment.