diff options
author | Nik Nyby <nikolas@gnu.org> | 2015-06-16 18:54:20 -0400 |
---|---|---|
committer | Nik Nyby <nikolas@gnu.org> | 2015-06-16 18:54:20 -0400 |
commit | 7cf6a6d2f2eb614d36f69cfce7fd771ac99643fb (patch) | |
tree | 0e69a84a5385fa91c36df2e3ee9c32738e68a4fc /lib | |
parent | ce90f57c6abbef577900078041388ea5a85bb2ef (diff) | |
download | librejsxul-7cf6a6d2f2eb614d36f69cfce7fd771ac99643fb.tar.lz librejsxul-7cf6a6d2f2eb614d36f69cfce7fd771ac99643fb.tar.xz librejsxul-7cf6a6d2f2eb614d36f69cfce7fd771ac99643fb.zip |
Add more charset checks to fix errors
Diffstat (limited to 'lib')
-rw-r--r-- | lib/http_observer/stream_loader.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/http_observer/stream_loader.js b/lib/http_observer/stream_loader.js index a90e341..09b4a63 100644 --- a/lib/http_observer/stream_loader.js +++ b/lib/http_observer/stream_loader.js @@ -140,7 +140,9 @@ StreamListener.prototype.onDetermineCharset = function onDetermineCharset( return loader.channel.contentCharset; } else { match = getRegexForContentType(loader.channel.contentType).exec(data); - if (match.length > 0 && + if (typeof match !== 'undefined' && + match !== null && + match.length > 0 && CHARSETS.indexOf(match[1].toLowerCase()) >= 0 ) { loader.channel.contentCharset = match[1]; |