summaryrefslogtreecommitdiffstats
path: root/toolkit/components/thumbnails/PageThumbs.jsm
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-25 12:34:50 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-25 12:34:50 +0200
commite437d80133c96096460bf9418f17f25a65a2db46 (patch)
tree5968a5d3d665e8c801f69d77ac094611dc1c1c37 /toolkit/components/thumbnails/PageThumbs.jsm
parentaab5ccc419bb90972e41565a1664653c905bb816 (diff)
downloadUXP-e437d80133c96096460bf9418f17f25a65a2db46.tar
UXP-e437d80133c96096460bf9418f17f25a65a2db46.tar.gz
UXP-e437d80133c96096460bf9418f17f25a65a2db46.tar.lz
UXP-e437d80133c96096460bf9418f17f25a65a2db46.tar.xz
UXP-e437d80133c96096460bf9418f17f25a65a2db46.zip
Use try/catch in PageThumbs writeData to deal with null data from caller.
Quick fix for #670
Diffstat (limited to 'toolkit/components/thumbnails/PageThumbs.jsm')
-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,