Fix CID 1386083 (Dereference null return value)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2018-06-29 17:46:54 +02:00
parent 2a30d77d75
commit 244b54bfc9

View File

@ -28,6 +28,7 @@ import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.awt.Window;
import javax.swing.Timer;
@ -262,7 +263,10 @@ public class SVEventHandler extends PBasicInputEventHandler implements
public void windowClosing(WindowEvent e) {
processEvent(new SVEvent(SVEventType.SVET_DESTROY, svWindow, lastXMove,
lastYMove, 0, 0, null));
e.getWindow().dispose();
Window w = e.getWindow();
if (w != null) {
w.dispose();
}
SVWindow.nrWindows--;
if (SVWindow.nrWindows == 0) {
processEvent(new SVEvent(SVEventType.SVET_EXIT, svWindow, lastXMove,