Skip to content

Commit ad04ed0

Browse files
hansonrhansonr
authored andcommitted
ToolTipManager may be for popup menu item, so then ancestor window may
be null
1 parent d44534e commit ad04ed0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sources/net.sf.j2s.java.core/src/javax/swing/ToolTipManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ void showTipWindow() {
272272
if (insideComponent == null || !insideComponent.isShowing())
273273
return;
274274
Component win = insideComponent.getTopLevelAncestor();
275-
if (win.isWindowOrJSApplet()) {
275+
// will be null for some menu items
276+
if (win != null && win.isWindowOrJSApplet()) {
276277
if (((Window) win).getModalBlocker() != null)
277278
return;
278279
}

0 commit comments

Comments
 (0)