Skip to content

Commit 9248fa4

Browse files
authored
Merge pull request #734 from quoid/fix/also-checks-if-the-directory-is-readable
fix: also checks if the user selected folder is readable
2 parents 55f0f1b + 5ad82b4 commit 9248fa4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

xcode/App-Mac/Functions.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@ func getSaveLocationURL() -> URL {
88
}
99

1010
func setSaveLocationURL(url: URL) -> Bool {
11+
guard FileManager.default.isReadableFile(atPath: url.path) else {
12+
let alert = NSAlert()
13+
alert.messageText = "Cannot read the specified path; please choose a different one."
14+
alert.runModal()
15+
return false
16+
}
1117
guard FileManager.default.isWritableFile(atPath: url.path) else {
1218
let alert = NSAlert()
13-
alert.messageText = "Can not write to path. Choose a different path."
19+
alert.messageText = "Cannot write to the specified path; please choose a different one."
1420
alert.runModal()
1521
return false
1622
}

0 commit comments

Comments
 (0)