Fix an NS_ERROR_FAILURE from nsIFileURL.file, though I don't yet know what causes it
This commit is contained in:
parent
6a42d2ee12
commit
1f93fa405c
1 changed files with 15 additions and 7 deletions
|
@ -1530,16 +1530,24 @@ Zotero.Translate.prototype._itemDone = function(item, attachedTo) {
|
|||
var uri = IOService.newURI(item.path, "", null);
|
||||
}
|
||||
catch (e) {
|
||||
Components.utils.reportError("Error parsing attachment path: " + item.path);
|
||||
Zotero.debug("Translate: Error parsing attachment path '" + item.path + "'", 2);
|
||||
var msg = "Error parsing attachment path: " + item.path;
|
||||
Components.utils.reportError(msg);
|
||||
Zotero.debug("Translate: " + msg, 2);
|
||||
}
|
||||
|
||||
if (uri) {
|
||||
try {
|
||||
var file = uri.QueryInterface(Components.interfaces.nsIFileURL).file;
|
||||
|
||||
if (file.path == '/') {
|
||||
Components.utils.reportError("Error parsing attachment path: " + item.path);
|
||||
Zotero.debug("Translate: Error parsing attachment attachment '" + item.path + "'", 2);
|
||||
var msg = "Error parsing attachment path: " + item.path;
|
||||
Components.utils.reportError(msg);
|
||||
Zotero.debug("Translate: " + msg, 2);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
var msg = "Error getting file from attachment path: " + item.path;
|
||||
Components.utils.reportError(msg);
|
||||
Zotero.debug("Translate: " + msg, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue