Commit 87c9a91
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 87c9a91
File tree
1 file changed
+1
-1
lines changed- bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1425 | 1425 | | |
1426 | 1426 | | |
1427 | 1427 | | |
1428 | | - | |
| 1428 | + | |
1429 | 1429 | | |
1430 | 1430 | | |
1431 | 1431 | | |
| |||
0 commit comments