Skip to content

Commit 4d8db77

Browse files
committed
null pointer checks for window (could already be closed)
1 parent 6062589 commit 4d8db77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

servoy_ngclient/src/com/servoy/j2db/server/ngclient/NGRuntimeWindowManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public Object executeMethod(String methodName, JSONObject args)
9898
if (size != null)
9999
{
100100
NGRuntimeWindow window = windowName == null ? (NGRuntimeWindow)getMainApplicationWindow() : getWindow(windowName);
101-
window.updateSize(size.optInt("width"), size.optInt("height"));
101+
if (window != null) window.updateSize(size.optInt("width"), size.optInt("height"));
102102
}
103103
break;
104104
}
@@ -109,7 +109,7 @@ public Object executeMethod(String methodName, JSONObject args)
109109
if (windowName != null && location != null)
110110
{
111111
NGRuntimeWindow window = getWindow(windowName);
112-
window.updateLocation(location.optInt("x"), location.optInt("y"));
112+
if (window != null) window.updateLocation(location.optInt("x"), location.optInt("y"));
113113
}
114114
break;
115115
}

0 commit comments

Comments
 (0)