fix(gui): NPE if the autosave is enabled and project is initial (PR #565)

This commit is contained in:
Ahmed Ashour
2019-04-08 12:05:22 +02:00
committed by skylot
parent 7b18d3a3a8
commit 0a08d8b653
@@ -91,11 +91,13 @@ public class JadxProject {
}
public void save() {
try (BufferedWriter writer = Files.newBufferedWriter(getProjectPath())) {
writer.write(GSON.toJson(this));
saved = true;
} catch (Exception e) {
LOG.error("Error saving project", e);
if (getProjectPath() != null) {
try (BufferedWriter writer = Files.newBufferedWriter(getProjectPath())) {
writer.write(GSON.toJson(this));
saved = true;
} catch (Exception e) {
LOG.error("Error saving project", e);
}
}
}