Skip to content

Commit

Permalink
improvement: Return undefined if empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Jan 8, 2025
1 parent 483bcf2 commit a8e5b7d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/metals-vscode/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,12 @@ export function getJavaVersionFromConfig() {
}

export function getJavaVersionOverride(): string | undefined {
return workspace
const javaVersion = workspace
.getConfiguration("metals")
.get<string>(UserConfiguration.MetalsJavaHome)
?.trim();
if (javaVersion && javaVersion.length > 0) return javaVersion;

Check failure on line 123 in packages/metals-vscode/src/util.ts

View workflow job for this annotation

GitHub Actions / Eslint

Expected { after 'if' condition
else return undefined;

Check failure on line 124 in packages/metals-vscode/src/util.ts

View workflow job for this annotation

GitHub Actions / Eslint

Expected { after 'else'
}

export async function fetchFrom(
Expand Down

0 comments on commit a8e5b7d

Please sign in to comment.