diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-08-05 11:35:53 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-08-05 11:35:53 +0200 |
commit | 6bd66b1728eeddb058066edda740aaeb2ceaec23 (patch) | |
tree | 985faf01c526763515731569fa01a99f4dbef36e /toolkit/components/thumbnails/PageThumbs.jsm | |
parent | e0a8dcfed131ffa58a5e2cb1d30fe48c745c2fdc (diff) | |
parent | 559824514dc95e02fbe81f1786e6ac13ee8e9d55 (diff) | |
download | UXP-6bd66b1728eeddb058066edda740aaeb2ceaec23.tar UXP-6bd66b1728eeddb058066edda740aaeb2ceaec23.tar.gz UXP-6bd66b1728eeddb058066edda740aaeb2ceaec23.tar.lz UXP-6bd66b1728eeddb058066edda740aaeb2ceaec23.tar.xz UXP-6bd66b1728eeddb058066edda740aaeb2ceaec23.zip |
Merge branch 'master' into js-modules
Diffstat (limited to 'toolkit/components/thumbnails/PageThumbs.jsm')
-rw-r--r-- | toolkit/components/thumbnails/PageThumbs.jsm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/toolkit/components/thumbnails/PageThumbs.jsm b/toolkit/components/thumbnails/PageThumbs.jsm index 9bd3ae4b3..5c7754b31 100644 --- a/toolkit/components/thumbnails/PageThumbs.jsm +++ b/toolkit/components/thumbnails/PageThumbs.jsm @@ -28,6 +28,9 @@ const MAX_THUMBNAIL_AGE_SECS = 172800; // 2 days == 60*60*24*2 == 172800 secs. */ const THUMBNAIL_DIRECTORY = "thumbnails"; +// contains base64 version of a placeholder thumbnail +#include blankthumb.inc + Cu.import("resource://gre/modules/XPCOMUtils.jsm", this); Cu.import("resource://gre/modules/PromiseWorker.jsm", this); Cu.import("resource://gre/modules/Promise.jsm", this); @@ -609,7 +612,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, |