Skip to content

Commit b8b205d

Browse files
author
zhourenjian
committed
Fix a bug that there are NullPointerExceptions for Shells with SWT.CENTER
1 parent 79d98f8 commit b8b205d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/internal/ResizeSystem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static void reset() {
7575
public static void updateResize() {
7676
for (int i = 0; i < handlers.length; i++) {
7777
ResizeHandler hdl = handlers[i];
78-
if (hdl != null) {
78+
if (hdl != null && hdl.shell != null && hdl.shell.handle != null) {
7979
hdl.shell._updateMonitorSize();
8080
int status = hdl.getStatus();
8181
if (status == SWT.MAX) {

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/internal/dnd/ShellFrameDND.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ public boolean dragBegan(DragEvent e) {
9292
e.startY = e.currentY;
9393
if (firstTime) {
9494
this.initFrameBounds(this.sourceX, this.sourceY, this.sourceWidth, this.sourceHeight);
95-
this.frame.style.width = this.sourceWidth + "px";
96-
this.frame.style.height = this.sourceHeight + "px";
9795
}
96+
this.frame.style.width = this.sourceWidth + "px";
97+
this.frame.style.height = this.sourceHeight + "px";
9898
Element[] frames = document.getElementsByTagName("IFRAME");
9999
if (frames.length != 0) {
100100
overFrameHandle = document.createElement ("DIV");

0 commit comments

Comments
 (0)