diff --git a/src/main/java/link/infra/packwiz/installer/DownloadTask.java b/src/main/java/link/infra/packwiz/installer/DownloadTask.java index 5d9ae2a..b4ddc18 100644 --- a/src/main/java/link/infra/packwiz/installer/DownloadTask.java +++ b/src/main/java/link/infra/packwiz/installer/DownloadTask.java @@ -187,7 +187,7 @@ class DownloadTask implements IOptionDetails { public boolean correctSide() { if (metadata.linkedFile != null) { - return downloadSide.hasSide(metadata.linkedFile.side); + return metadata.linkedFile.side.hasSide(downloadSide); } return true; } diff --git a/src/main/java/link/infra/packwiz/installer/UpdateManager.java b/src/main/java/link/infra/packwiz/installer/UpdateManager.java index 204da03..ee482fb 100644 --- a/src/main/java/link/infra/packwiz/installer/UpdateManager.java +++ b/src/main/java/link/infra/packwiz/installer/UpdateManager.java @@ -323,8 +323,16 @@ public class UpdateManager { task = null; } // Update manifest - If there were no errors cachedFile has already been modified in place (good old pass by reference) - if (task != null && task.getException() != null) { - manifest.cachedFiles.put(task.metadata.file, task.cachedFile.getRevert()); + if (task != null) { + if (task.getException() != null) { + ManifestFile.File file = task.cachedFile.getRevert(); + if (file != null) { + manifest.cachedFiles.put(task.metadata.file, file); + } + } else { + // idiot, if it wasn't there in the first place it won't magically appear there + manifest.cachedFiles.putIfAbsent(task.metadata.file, task.cachedFile); + } } // TODO: show errors properly? String progress;