mirror of
https://github.com/zotero/zotero.git
synced 2026-08-28 05:25:31 +00:00
Handle unparseable paths in getClosestDirectory()
On Windows, stat rejects a POSIX-style path with NS_ERROR_FILE_UNRECOGNIZED_PATH rather than a not-found error.
This commit is contained in:
parent
cdb13af13b
commit
f5a2985a34
1 changed files with 5 additions and 0 deletions
|
|
@ -103,6 +103,11 @@ Zotero.File = new function () {
|
|||
}
|
||||
catch (e) {
|
||||
if (e.becauseNoSuchFile) {}
|
||||
// A path that can't be parsed (e.g., a POSIX-style path on Windows) doesn't
|
||||
// exist either
|
||||
else if (e.message?.includes('NS_ERROR_FILE_UNRECOGNIZED_PATH')) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
throw e;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue