From d204ed8ac93d1ae3606f8d701cb2accc81fd2d0a Mon Sep 17 00:00:00 2001 From: cha0s Date: Sun, 3 Jan 2021 20:24:08 -0600 Subject: [PATCH] fix: don't throw on haystack not being array --- packages/behavior/src/compilers/condition.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/behavior/src/compilers/condition.js b/packages/behavior/src/compilers/condition.js index eac8181..f8e4bc0 100644 --- a/packages/behavior/src/compilers/condition.js +++ b/packages/behavior/src/compilers/condition.js @@ -39,6 +39,9 @@ export default (latus) => (condition) => { return true; case 'contains': { const haystack = operands[0](context); + if (!Array.isArray(haystack)) { + return false; + } const needle = operands[1](context); return -1 !== haystack.indexOf(needle); }