Skip to content

Commit

Permalink
0.6.1: fix error cannot read property 'replace' of undefined. (#164)
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Zhang <[email protected]>
  • Loading branch information
Eskibear authored Nov 13, 2020
1 parent c1b6842 commit 6fc6e4b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Change Log
All notable changes to the "vscode-spring-initializr" extension will be documented in this file.

## 0.6.1
- Fix Error: Cannot read property 'split' of undefined. [#162](https://github.com/microsoft/vscode-spring-initializr/issues/162#issuecomment-726832226)

## 0.6.0
- Allow commands to start initializr wizard with default selections.
- Add a new setting `spring.initializr.defaultOpenProjectMethod` for default project opening method.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-spring-initializr",
"displayName": "Spring Initializr Java Support",
"description": "A lightweight extension based on Spring Initializr to generate quick start Spring Boot Java projects.",
"version": "0.6.0",
"version": "0.6.1",
"icon": "resources/logo.png",
"publisher": "vscjava",
"aiKey": "05fb8871-fbf0-488f-8453-a74cf0ca9b93",
Expand Down
9 changes: 6 additions & 3 deletions src/Utils/VersionHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,16 @@ export function compareVersions(a: string, b: string): number {
return result;
}
}
const aqual: string = parseQualifier(versionA[3]);
const bqual: string = parseQualifier(versionB[3]);
// version[3] can be undefined
const aqualRaw: string = versionA[3] || "RELEASE";
const bqualRaw: string = versionB[3] || "RELEASE";
const aqual: string = parseQualifier(aqualRaw);
const bqual: string = parseQualifier(bqualRaw);
result = qualifiers.indexOf(aqual) - qualifiers.indexOf(bqual);
if (result !== 0) {
return result;
}
return versionA[3].localeCompare(versionB[3]);
return aqualRaw.localeCompare(bqualRaw);
}

function parseQualifier(version: string): string {
Expand Down

0 comments on commit 6fc6e4b

Please sign in to comment.