Restore proper error for Show File on missing file

This commit is contained in:
Dan Stillman 2016-03-23 01:52:59 -04:00
parent a1ce85decb
commit 002dd66e03

View file

@ -3940,8 +3940,9 @@ var ZoteroPane = new function()
this.showAttachmentInFilesystem = Zotero.Promise.coroutine(function* (itemID, noLocateOnMissing) { this.showAttachmentInFilesystem = Zotero.Promise.coroutine(function* (itemID, noLocateOnMissing) {
var attachment = yield Zotero.Items.getAsync(itemID) var attachment = yield Zotero.Items.getAsync(itemID)
if (attachment.attachmentLinkMode != Zotero.Attachments.LINK_MODE_LINKED_URL) { if (attachment.attachmentLinkMode != Zotero.Attachments.LINK_MODE_LINKED_URL) {
var file = attachment.getFile(); var path = yield attachment.getFilePathAsync();
if (file) { if (path) {
let file = Zotero.File.pathToFile(path);
try { try {
file.reveal(); file.reveal();
} }