Commit bef3ad7
Fix NPEs in MenuItem#calculateRenderSize() and MenuItem#getMonitorZoom()
Previously, calculateRenderSize() and getMonitorZoom() of MenuItem used
getMenu() to get some context providing the relevant shell instead of
getParent(). Since that menu may be null when the MenuItem has no submenu
(e.g., PUSH, CHECK styles), an NPE might have been thrown.
This change replaces getMenu().getShell() with getParent().getShell(),
ensuring a valid shell is always used regardless of item type.
Fixes #22471 parent fc94eaf commit bef3ad7
File tree
1 file changed
+2
-2
lines changed- bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1291 | 1291 | | |
1292 | 1292 | | |
1293 | 1293 | | |
1294 | | - | |
| 1294 | + | |
1295 | 1295 | | |
1296 | 1296 | | |
1297 | 1297 | | |
| |||
1425 | 1425 | | |
1426 | 1426 | | |
1427 | 1427 | | |
1428 | | - | |
| 1428 | + | |
1429 | 1429 | | |
1430 | 1430 | | |
1431 | 1431 | | |
| |||
0 commit comments