diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-12-14 16:59:44 -0500 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-12-29 12:33:03 -0500 |
commit | 3033fea31e4bc9ba7198d2d31d6f6046813926d1 (patch) | |
tree | 4d6e212260ee9bca9f4807fe6d6fefbe9ed12f22 /ext/bg/js/util.js | |
parent | 024f969bfd884e43cd40f408d0e3ba32839be45f (diff) |
Treat null templates as the default value
Diffstat (limited to 'ext/bg/js/util.js')
-rw-r--r-- | ext/bg/js/util.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js index c88c2768..0527dc0b 100644 --- a/ext/bg/js/util.js +++ b/ext/bg/js/util.js @@ -88,6 +88,8 @@ function utilSetDifference(setA, setB) { function utilStringHashCode(string) { let hashCode = 0; + if (typeof string !== 'string') { return hashCode; } + for (let i = 0, charCode = string.charCodeAt(i); i < string.length; charCode = string.charCodeAt(++i)) { hashCode = ((hashCode << 5) - hashCode) + charCode; hashCode |= 0; |