diff --git a/jadx-gui/src/main/java/jadx/gui/settings/data/ProjectData.java b/jadx-gui/src/main/java/jadx/gui/settings/data/ProjectData.java index cc84ff23..ae61884d 100644 --- a/jadx-gui/src/main/java/jadx/gui/settings/data/ProjectData.java +++ b/jadx-gui/src/main/java/jadx/gui/settings/data/ProjectData.java @@ -4,13 +4,14 @@ import java.nio.file.Path; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Objects; import jadx.api.data.impl.JadxCodeData; public class ProjectData { private int projectVersion = 1; - private List files; + private List files = new ArrayList<>(); private List treeExpansions = new ArrayList<>(); private JadxCodeData codeData = new JadxCodeData(); private List openTabs = Collections.emptyList(); @@ -21,7 +22,7 @@ public class ProjectData { } public void setFiles(List files) { - this.files = files; + this.files = Objects.requireNonNull(files); } public List getTreeExpansions() { 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 02f48f66..fa12bcec 100644 --- a/jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java +++ b/jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java @@ -76,6 +76,7 @@ import javax.swing.tree.TreePath; import javax.swing.tree.TreeSelectionModel; import org.fife.ui.rsyntaxtextarea.Theme; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -178,7 +179,8 @@ public class MainWindow extends JFrame { private final transient JadxSettings settings; private final transient CacheObject cacheObject; private final transient BackgroundExecutor backgroundExecutor; - private transient JadxProject project; + @NotNull + private transient JadxProject project = new JadxProject(); private transient Action newProjectAction; private transient Action saveProjectAction; @@ -516,7 +518,7 @@ public class MainWindow extends JFrame { return jadxProject.getFilePaths(); } - public void updateProject(JadxProject jadxProject) { + public void updateProject(@NotNull JadxProject jadxProject) { jadxProject.setSettings(settings); jadxProject.setMainWindow(this); this.project = jadxProject;