Skip to content

Commit d64f946

Browse files
author
emmanue1
committed
Fix exception when application is launched with arguments
1 parent c408b63 commit d64f946

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

app/src/main/java/org/jd/gui/App.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ public static void main(String[] args) {
5959

6060
// Create main controller and show main frame
6161
controller = new MainController(configuration);
62-
controller.show();
63-
controller.openFiles(newList(args));
62+
controller.show(newList(args));
6463
}
6564
}
6665

app/src/main/java/org/jd/gui/controller/MainController.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ public MainController(Configuration configuration) {
111111

112112
// --- Show GUI --- //
113113
@SuppressWarnings("unchecked")
114-
public void show() {
114+
public void show(List<File> files) {
115115
SwingUtil.invokeLater(() -> {
116116
// Show main frame
117-
mainView.show(
118-
configuration.getMainWindowLocation(),
119-
configuration.getMainWindowSize(),
120-
configuration.isMainWindowMaximize());
117+
mainView.show(configuration.getMainWindowLocation(), configuration.getMainWindowSize(), configuration.isMainWindowMaximize());
118+
if (!files.isEmpty()) {
119+
openFiles(files);
120+
}
121121
});
122122

123123
// Background initializations

0 commit comments

Comments
 (0)