Skip to content

Commit

Permalink
fix error when non existing build is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
SenkJu committed Dec 28, 2023
1 parent 1ef7661 commit f5daf52
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/main/MainScreen.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,13 @@
// The find() method returns a value of the first element in the array that satisfies the provided testing function. Otherwise undefined is returned.
return builds.find(e => e.release || options.showNightlyBuilds);
}
let build = builds.find((build) => build.buildId === options.preferredBuild);
if (!build) {
return builds[0];
}
return builds.find((build) => build.buildId === options.preferredBuild);
return build;
}
function hideSettings() {
Expand Down

0 comments on commit f5daf52

Please sign in to comment.