Skip to content

Commit

Permalink
Fix CID 1386083 (Dereference null return value)
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Jun 29, 2018
1 parent 2a30d77 commit 244b54b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion java/com/google/scrollview/events/SVEventHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.awt.event.KeyListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.awt.Window;

import javax.swing.Timer;

Expand Down Expand Up @@ -262,7 +263,10 @@ public void keyPressed(KeyEvent e) {
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,
Expand Down

0 comments on commit 244b54b

Please sign in to comment.