Skip to content

Commit

Permalink
Gson isn't broken, I'm broken
Browse files Browse the repository at this point in the history
  • Loading branch information
comp500 committed Jun 24, 2019
1 parent d18e134 commit 533c7a3
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/java/link/infra/packwiz/installer/UpdateManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,16 @@ protected void start() {

ui.submitProgress(new InstallProgress("Loading manifest file..."));
Gson gson = new Gson();
ManifestFile manifest = null;
ManifestFile manifest;
try {
manifest = gson.fromJson(new FileReader(Paths.get(opts.packFolder, opts.manifestFile).toString()),
ManifestFile.class);
} catch (FileNotFoundException e) { // Do nothing
} catch (FileNotFoundException e) {
manifest = new ManifestFile();
} catch (JsonSyntaxException | JsonIOException e) {
ui.handleExceptionAndExit(e);
return;
}
if (manifest == null) {
manifest = new ManifestFile();
}

ui.submitProgress(new InstallProgress("Loading pack file..."));
GeneralHashingSource packFileSource;
Expand All @@ -142,7 +140,7 @@ protected void start() {
return;
}

if (packFileSource.hashIsEqual(manifest.packFileHash)) {
if (manifest.packFileHash != null && packFileSource.hashIsEqual(manifest.packFileHash)) {
System.out.println("Hash already up to date!");
// WOOO it's already up to date
// todo: --force?
Expand Down

0 comments on commit 533c7a3

Please sign in to comment.