File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
sources/net.sf.j2s.java.core/src/java/awt Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1867,17 +1867,21 @@ public Point getLocationOnScreen() {
18671867 */
18681868 final Point getLocationOnScreen_NoTreeLock () {
18691869 if (isShowing ()) {
1870- if (isLightweight ()) {// peer instanceof LightweightPeer) { // SwingJS will return FALSE
1870+ if (isLightweight ()) {
18711871 // lightweight component location needs to be translated
18721872 // relative to a native component.
18731873 Container host = getNativeContainer ();
1874+ if (host .peer == null )
1875+ return null ;
18741876 Point pt = host .peer .getLocationOnScreen ();
18751877 for (Component c = this ; c != host ; c = c .getParent ()) {
18761878 pt .x += c .x ;
18771879 pt .y += c .y ;
18781880 }
18791881 return pt ;
18801882 } else {
1883+ if (peer == null )
1884+ return null ;
18811885 Point pt = peer .getLocationOnScreen ();
18821886 return pt ;
18831887 }
You can’t perform that action at this time.
0 commit comments