mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 00:08:39 +09:00
Use try/catch in PageThumbs writeData to deal with null data from caller.
Quick fix for #670
This commit is contained in:
parent
54a727b3cb
commit
49f881cb96
1 changed files with 9 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue