diff --git a/jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java b/jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java index 1ffb735ff15..d99fd9cca5a 100644 --- a/jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java +++ b/jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java @@ -200,16 +200,19 @@ private void processCommandLineArgs() { openFileOrProject(); } else { open(Paths.get(settings.getFiles().get(0))); - if (settings.getCmdSelectClass() != null) { - JavaNode javaNode = wrapper.searchJavaClassByClassName(settings.getCmdSelectClass()); - if (javaNode == null) { - JOptionPane.showMessageDialog(this, - NLS.str("msg.cmd_select_class_error", settings.getCmdSelectClass()), - NLS.str("error_dialog.title"), JOptionPane.ERROR_MESSAGE); - } else { - JNode node = cacheObject.getNodeCache().makeFrom(javaNode); - tabbedPane.codeJump(new JumpPosition(node.getRootClass(), node.getLine())); - } + } + } + + private void handleSelectClassOption() { + if (settings.getCmdSelectClass() != null) { + JavaNode javaNode = wrapper.searchJavaClassByClassName(settings.getCmdSelectClass()); + if (javaNode == null) { + JOptionPane.showMessageDialog(this, + NLS.str("msg.cmd_select_class_error", settings.getCmdSelectClass()), + NLS.str("error_dialog.title"), JOptionPane.ERROR_MESSAGE); + } else { + JNode node = cacheObject.getNodeCache().makeFrom(javaNode); + tabbedPane.codeJump(new JumpPosition(node.getRootClass(), node.getLine())); } } } @@ -313,6 +316,7 @@ void open(Path path) { deobfToggleBtn.setSelected(settings.isDeobfuscationOn()); initTree(); update(); + handleSelectClassOption(); runBackgroundJobs(); }); }