Commit 17d1f18
committed
fix: guard optional message field in showMessageBox catch handler
Add optional chaining to options.message?.length in the catch handler
and update the messageLength schema to NullOr(Schema.Number) for
consistency with titleLength and detailLength. Previously, if message
was omitted from MessageBoxOptions and the dialog promise rejected,
accessing .length on undefined would throw a TypeError inside catch,
bypassing the typed ElectronDialogShowMessageBoxError.1 parent 513653f commit 17d1f18
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| |||
0 commit comments