summaryrefslogtreecommitdiffstats
path: root/toolkit
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/components/thumbnails/PageThumbs.jsm10
1 files changed, 9 insertions, 1 deletions
diff --git a/toolkit/components/thumbnails/PageThumbs.jsm b/toolkit/components/thumbnails/PageThumbs.jsm
index 9bd3ae4b3..b0affee92 100644
--- a/toolkit/components/thumbnails/PageThumbs.jsm
+++ b/toolkit/components/thumbnails/PageThumbs.jsm
@@ -609,7 +609,15 @@ this.PageThumbsStorage = {
writeData: function Storage_writeData(aURL, aData, aNoOverwrite) {
let path = this.getFilePathForURL(aURL);
this.ensurePath();
- aData = new Uint8Array(aData);
+
+ // XXX: We try/catch here since 'null' isn't accepted until we implement
+ // ES2017's new Uint8Array(); allowance.
+ try {
+ aData = new Uint8Array(aData);
+ } catch(e) {
+ aData = new Uint8Array(0);
+ }
+
let msg = [
path,
aData,