Skip to content

Commit 244b54b

Browse files
committed
Fix CID 1386083 (Dereference null return value)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent 2a30d77 commit 244b54b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

java/com/google/scrollview/events/SVEventHandler.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.awt.event.KeyListener;
2929
import java.awt.event.WindowEvent;
3030
import java.awt.event.WindowListener;
31+
import java.awt.Window;
3132

3233
import javax.swing.Timer;
3334

@@ -262,7 +263,10 @@ public void keyPressed(KeyEvent e) {
262263
public void windowClosing(WindowEvent e) {
263264
processEvent(new SVEvent(SVEventType.SVET_DESTROY, svWindow, lastXMove,
264265
lastYMove, 0, 0, null));
265-
e.getWindow().dispose();
266+
Window w = e.getWindow();
267+
if (w != null) {
268+
w.dispose();
269+
}
266270
SVWindow.nrWindows--;
267271
if (SVWindow.nrWindows == 0) {
268272
processEvent(new SVEvent(SVEventType.SVET_EXIT, svWindow, lastXMove,

0 commit comments

Comments
 (0)