Skip to content

Commit

Permalink
Fix: Don't throw exception if git_hash is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed Mar 12, 2024
1 parent bd8d93b commit 437f572
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion webapp/src/views/SystemInfoView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,16 @@ export default defineComponent({
})
},
getUpdateInfo() {
if (this.systemDataList.git_hash === undefined) {
return;
}
// If the left char is a "g" the value is the git hash (remove the "g")
this.systemDataList.git_is_hash = this.systemDataList.git_hash?.substring(0, 1) == 'g';
this.systemDataList.git_hash = this.systemDataList.git_is_hash ? this.systemDataList.git_hash?.substring(1) : this.systemDataList.git_hash;
// Handle format "v0.1-5-gabcdefh"
if (this.systemDataList.git_hash.lastIndexOf("-") >= 0) {
if (this.systemDataList.git_hash?.lastIndexOf("-") >= 0) {
this.systemDataList.git_hash = this.systemDataList.git_hash.substring(this.systemDataList.git_hash.lastIndexOf("-") + 2)
this.systemDataList.git_is_hash = true;
}
Expand Down

0 comments on commit 437f572

Please sign in to comment.