Commit b1043eb
committed
Fix NPE in MenuItem#calculateRenderSize for non-cascade items
Previously, calculateRenderSize created a GC using getMenu().getShell(),
which throws a NullPointerException when the MenuItem has no submenu
(e.g., PUSH, CHECK styles).
This change replaces getMenu().getShell() with getParent().getShell(),
ensuring a valid shell is always used regardless of item type.
fixes: #22471 parent fc94eaf commit b1043eb
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