mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 06:57:13 -06:00
MenuBar: fixed NPE in FlatMenuItemRenderer.getTopLevelFont() if menu item does not have a parent (issue #600; regression since implementing #589 in FlatLaf 2.5; commit f6c5db07f2)
This commit is contained in:
@@ -500,7 +500,11 @@ debug*/
|
||||
|
||||
private Font getTopLevelFont() {
|
||||
Font font = menuItem.getFont();
|
||||
return (font != menuFont) ? font : menuItem.getParent().getFont();
|
||||
// menu item parent may be null if JMenu.isTopLevelMenu() is overridden
|
||||
// and does not check parent (e.g. com.jidesoft.swing.JideMenu.isTopLevelMenu())
|
||||
return (font != menuFont || menuItem.getParent() == null)
|
||||
? font
|
||||
: menuItem.getParent().getFont();
|
||||
}
|
||||
|
||||
private Icon getIconForPainting() {
|
||||
|
||||
Reference in New Issue
Block a user