Commit 15ea9a5
fix: handle null bounds in WindowLocation to prevent NPE on dialog dispose (PR #2826)
* fix: handle null bounds in WindowLocation to prevent NPE on dialog dispose
The equals(), hashCode(), and toString() methods in WindowLocation
could throw NullPointerException when bounds is null. This happens
when a dialog window is disposed before its bounds are fully
initialized (e.g., on macOS when closing the search dialog).
Use Objects.equals()/Objects.hashCode() for null-safe comparisons
and add a null guard in toString().
Fixes #2571
* additional null checks and null annotations
---------
Co-authored-by: easonysliu <easonysliu@tencent.com>
Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>1 parent 165ae24 commit 15ea9a5
2 files changed
Lines changed: 34 additions & 25 deletions
Lines changed: 21 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
223 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
224 | 232 | | |
225 | | - | |
226 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
227 | 238 | | |
228 | 239 | | |
229 | 240 | | |
230 | 241 | | |
231 | | - | |
232 | | - | |
233 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
234 | 245 | | |
235 | 246 | | |
236 | | - | |
| 247 | + | |
| 248 | + | |
237 | 249 | | |
238 | 250 | | |
239 | | - | |
| 251 | + | |
240 | 252 | | |
241 | 253 | | |
242 | 254 | | |
243 | 255 | | |
244 | 256 | | |
245 | 257 | | |
246 | | - | |
247 | | - | |
| 258 | + | |
248 | 259 | | |
249 | 260 | | |
250 | 261 | | |
251 | 262 | | |
252 | 263 | | |
253 | 264 | | |
254 | | - | |
| 265 | + | |
255 | 266 | | |
256 | 267 | | |
257 | 268 | | |
| |||
Lines changed: 13 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | | - | |
| 11 | + | |
8 | 12 | | |
9 | | - | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
13 | | - | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
26 | | - | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
30 | | - | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
36 | | - | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
43 | | - | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | | - | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 55 | + | |
58 | 56 | | |
59 | 57 | | |
0 commit comments