From 8b8806484ebd7a14a10892f8bd40dc13b0361a95 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 4 Oct 2020 19:04:21 -0400 Subject: Add check to verify expressions are strings (#883) --- ext/bg/js/translator.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ext/bg') diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js index c5077977..5f91205d 100644 --- a/ext/bg/js/translator.js +++ b/ext/bg/js/translator.js @@ -1176,6 +1176,8 @@ class Translator { const expression1 = v1.expression; const expression2 = v2.expression; + if (typeof expression1 !== 'string' || typeof expression2 !== 'string') { return 0; } // Skip if either is not a string (array) + i = expression2.length - expression1.length; if (i !== 0) { return i; } -- cgit v1.2.3