Skip to content

Commit 02a428f

Browse files
- Removed endAccessing issue
1 parent 2a388e1 commit 02a428f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/WelcomeWindow/Model/NSDocumentController+Extensions.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,10 @@ extension NSDocumentController {
183183
) {
184184
let accessGranted = RecentsStore.beginAccessing(url)
185185
openDocument(withContentsOf: url, display: true) { _, _, error in
186-
defer { if accessGranted { RecentsStore.endAccessing(url) } }
187186
if let error {
187+
if accessGranted {
188+
RecentsStore.endAccessing(url)
189+
}
188190
NSAlert(error: error).runModal()
189191
onError(error)
190192
} else {

0 commit comments

Comments
 (0)