aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-10-04 19:04:21 -0400
committerGitHub <noreply@github.com>2020-10-04 19:04:21 -0400
commit8b8806484ebd7a14a10892f8bd40dc13b0361a95 (patch)
tree3852608763cf9863bd69ccad1cb4a6cb8334c0b6 /ext/bg/js/translator.js
parentf904b3e11a6624918da23fd0b15bf8c1c7248478 (diff)
Add check to verify expressions are strings (#883)
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r--ext/bg/js/translator.js2
1 files changed, 2 insertions, 0 deletions
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; }