Skip to content

Commit 9f7ae09

Browse files
hansonrhansonr
authored andcommitted
root may be null
1 parent e3c90f8 commit 9f7ae09

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSComponentUI.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3141,7 +3141,8 @@ public void setZ(int z) {
31413141
* @param c
31423142
*/
31433143
public static void containerToFront(JComponent c) {
3144-
Component w = c.getRootPane().getParent();
3144+
Component root = c.getRootPane();
3145+
Component w = (root == null ? null : root.getParent());
31453146
if (w instanceof Window)
31463147
((Window) w).toFront();
31473148
}

0 commit comments

Comments
 (0)