mirror of
https://github.com/zotero/zotero.git
synced 2026-09-12 23:01:22 +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.
(cherry picked from commit f5a2985a34)
This commit is contained in:
parent
d9e553b60c
commit
33af51c7a1
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