Commit 7ad818f
fix: handle nil Finder selection on macOS 15+
On macOS 15+, `finder.selection?.get()` via ScriptingBridge returns nil
when nothing is selected (older macOS returned an empty array). The old
`guard let selection, let selectionItems = selection.get() else throw`
misread this as a permission failure, so every click with no selection
surfaced `OITError.cannotAccessFinder` and fell out of `openOutsideSandbox`
silently — the lite binary only writes the error to `~/Library/Logs` and
exits, giving the user no feedback.
Treat nil as an empty selection and fall through to the front-window
check. Also unify the singular and plural helpers on the safer
`as? [FinderItem]` cast (dropping an unsound `as! FinderItem` on
individual items in the singular variant).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent bee2c57 commit 7ad818f
1 file changed
Lines changed: 19 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
| 63 | + | |
63 | 64 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
0 commit comments