Fix empty preconditions not firing
This commit is contained in:
1 parent
e57d73267e
commit
9ba078870a
1 file changed
+3
-1
+3
-1
@@ -158,7 +158,8 @@ async function fetchPresets(): Promise<Preset[]> {
|
||||
}
|
||||
|
||||
const events = preset["events"] || {};
|
||||
let precondition;
|
||||
let precondition = true as Expression;
|
||||
if (preset["precondition"]) {
|
||||
try {
|
||||
precondition = parse(preset["precondition"]);
|
||||
} catch (error) {
|
||||
@@ -167,6 +168,7 @@ async function fetchPresets(): Promise<Preset[]> {
|
||||
|
||||
// Simplify expression
|
||||
precondition = expression.evaluate(precondition);
|
||||
}
|
||||
|
||||
const _provisions = preset["provisions"] || [];
|
||||
|
||||
|
||||
Reference in new issue
Block a user