aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2018-03-03 21:29:40 +0100
committerLibravatar GitHub <noreply@github.com>2018-03-03 21:29:40 +0100
commit27b0c0203aaf283dd77f4f93c22f2d3b0e0d3802 (patch)
treeee3bb7ee6091d8f4b9dc0858aa2273ca72206eda
parentUpdate changelog (diff)
parentREMOVE invalid semver version tantrum (diff)
downloadferdium-app-27b0c0203aaf283dd77f4f93c22f2d3b0e0d3802.tar.gz
ferdium-app-27b0c0203aaf283dd77f4f93c22f2d3b0e0d3802.tar.zst
ferdium-app-27b0c0203aaf283dd77f4f93c22f2d3b0e0d3802.zip
fix(App): Fix app getting stuck on load when recipe has an invalid version identifier
REMOVE invalid semver version tantrum
-rw-r--r--src/models/Recipe.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/models/Recipe.js b/src/models/Recipe.js
index 1fc23ac89..032a9aa19 100644
--- a/src/models/Recipe.js
+++ b/src/models/Recipe.js
@@ -32,8 +32,12 @@ export default class Recipe {
32 throw Error(`Recipe '${data.name}' requires Id`); 32 throw Error(`Recipe '${data.name}' requires Id`);
33 } 33 }
34 34
35 if (!semver.valid(data.version)) { 35 try {
36 throw Error(`Version ${data.version} of recipe '${data.name}' is not a valid semver version`); 36 if (!semver.valid(data.version)) {
37 throw Error(`Version ${data.version} of recipe '${data.name}' is not a valid semver version`);
38 }
39 } catch (e) {
40 console.warn(e.message);
37 } 41 }
38 42
39 this.id = data.id || this.id; 43 this.id = data.id || this.id;