Skip to content

Commit

Permalink
Fix exception when application is launched with arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanue1 committed Apr 8, 2019
1 parent c408b63 commit d64f946
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions app/src/main/java/org/jd/gui/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ public static void main(String[] args) {

// Create main controller and show main frame
controller = new MainController(configuration);
controller.show();
controller.openFiles(newList(args));
controller.show(newList(args));
}
}

Expand Down
10 changes: 5 additions & 5 deletions app/src/main/java/org/jd/gui/controller/MainController.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ public MainController(Configuration configuration) {

// --- Show GUI --- //
@SuppressWarnings("unchecked")
public void show() {
public void show(List<File> files) {
SwingUtil.invokeLater(() -> {
// Show main frame
mainView.show(
configuration.getMainWindowLocation(),
configuration.getMainWindowSize(),
configuration.isMainWindowMaximize());
mainView.show(configuration.getMainWindowLocation(), configuration.getMainWindowSize(), configuration.isMainWindowMaximize());
if (!files.isEmpty()) {
openFiles(files);
}
});

// Background initializations
Expand Down

0 comments on commit d64f946

Please sign in to comment.