diff --git a/src/main/java/com/replaymod/recording/packet/ResourcePackRecorder.java b/src/main/java/com/replaymod/recording/packet/ResourcePackRecorder.java index d4cb6c0f..ed5cfc7f 100644 --- a/src/main/java/com/replaymod/recording/packet/ResourcePackRecorder.java +++ b/src/main/java/com/replaymod/recording/packet/ResourcePackRecorder.java @@ -27,6 +27,7 @@ import javax.annotation.Nonnull; import java.io.File; import java.io.IOException; import java.io.OutputStream; +import java.util.HashMap; import java.util.Map; /** @@ -53,6 +54,9 @@ public class ResourcePackRecorder { boolean doWrite = false; // Whether we are the first and have to write it synchronized (replayFile) { // Need to read, modify and write the resource pack index atomically Map index = replayFile.getResourcePackIndex(); + if (index == null) { + index = new HashMap<>(); + } if (!index.containsValue(hash)) { // Hash is unknown, we have to write the resource pack ourselves doWrite = true;