parent
d4b2fbf33b
commit
e35c220be4
1 changed files with 14 additions and 3 deletions
|
@ -5845,10 +5845,21 @@ var ZoteroPane = new function()
|
|||
for (let segmentsToDrop = 0; segmentsToDrop < parts.length; segmentsToDrop++) {
|
||||
let correctedPath = join(basePath, ...parts.slice(segmentsToDrop));
|
||||
|
||||
try {
|
||||
if (!(await IOUtils.exists(correctedPath))) {
|
||||
Zotero.debug('Does not exist: ' + correctedPath);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
// IOUtils.exists() throws if the path is invalid - suppress that
|
||||
if (e.name === 'NS_ERROR_FILE_UNRECOGNIZED_PATH') {
|
||||
Zotero.debug('Invalid path: ' + correctedPath);
|
||||
continue;
|
||||
}
|
||||
// Otherwise this could be a meaningful filesystem error, so re-throw
|
||||
throw e;
|
||||
}
|
||||
Zotero.debug('Exists! ' + correctedPath);
|
||||
|
||||
if (Zotero.isWin) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue