Skip to content

Commit 1b13bde

Browse files
committed
fix quit action - getActiveShell() returns null
1 parent bb2652b commit 1b13bde

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/net/azib/ipscan/gui/actions/ScanMenuActions.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
import net.azib.ipscan.gui.StatusBar;
2323
import net.azib.ipscan.gui.feeders.FeederGUIRegistry;
2424
import org.eclipse.swt.SWT;
25-
import org.eclipse.swt.widgets.Event;
26-
import org.eclipse.swt.widgets.FileDialog;
27-
import org.eclipse.swt.widgets.Listener;
28-
import org.eclipse.swt.widgets.MessageBox;
25+
import org.eclipse.swt.widgets.*;
2926

3027
import java.io.File;
3128
import java.util.ArrayList;
@@ -212,11 +209,14 @@ public SaveSelection(ExporterRegistry exporterRegistry, ResultTable resultTable,
212209
}
213210

214211
public static final class Quit implements Listener {
215-
public Quit() {
212+
private final Shell shell;
213+
214+
public Quit(Shell shell) {
215+
this.shell = shell;
216216
}
217217

218218
public void handleEvent(Event event) {
219-
event.display.getActiveShell().close();
219+
shell.close();
220220
}
221221
}
222222

@@ -232,4 +232,4 @@ public void run() {
232232
}
233233
}
234234

235-
}
235+
}

0 commit comments

Comments
 (0)