Bug 1258797 - Catch error when trying to open save as dialog to invalid path. r=Gijs

MozReview-Commit-ID: GbMgcfOgVaq

--HG--
extra : rebase_source : da89a0b7d2c66e8c744395f874a6b5fc61516454
This commit is contained in:
Ian Moody 2017-09-30 17:51:05 +01:00
Родитель 6b20a710cf
Коммит 88c31186c4
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -143,9 +143,13 @@ DownloadLastDir.prototype = {
let file = plainPrefFile;
if (aReason == Components.interfaces.nsIContentPrefCallback2.COMPLETE_OK &&
result instanceof Components.interfaces.nsIContentPref) {
file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsIFile);
file.initWithPath(result.value);
try {
file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsIFile);
file.initWithPath(result.value);
} catch (e) {
file = plainPrefFile;
}
}
aCallback(file);
}