diff --git a/recaf-core/src/main/java/software/coley/recaf/workspace/io/BasicResourceImporter.java b/recaf-core/src/main/java/software/coley/recaf/workspace/io/BasicResourceImporter.java index 46af90f4f..bc0a57dde 100644 --- a/recaf-core/src/main/java/software/coley/recaf/workspace/io/BasicResourceImporter.java +++ b/recaf-core/src/main/java/software/coley/recaf/workspace/io/BasicResourceImporter.java @@ -150,13 +150,15 @@ private WorkspaceFileResource handleZip(WorkspaceResourceBuilder builder, ZipFil } // Record common entry attributes - CentralDirectoryFileHeader centralHeader = header.getLinkedDirectoryFileHeader(); ZipCompressionProperty.set(info, header.getCompressionMethod()); - if (centralHeader.getFileCommentLength() > 0) - ZipCommentProperty.set(info, centralHeader.getFileCommentAsString()); ExtraFieldTime.TimeWrapper extraTimes = ExtraFieldTime.read(header); - if (extraTimes == null) - extraTimes = ExtraFieldTime.read(centralHeader); + CentralDirectoryFileHeader centralHeader = header.getLinkedDirectoryFileHeader(); + if (centralHeader != null) { + if (centralHeader.getFileCommentLength() > 0) + ZipCommentProperty.set(info, centralHeader.getFileCommentAsString()); + if (extraTimes == null) + extraTimes = ExtraFieldTime.read(centralHeader); + } if (extraTimes != null) { ZipCreationTimeProperty.set(info, extraTimes.getCreationMs()); ZipModificationTimeProperty.set(info, extraTimes.getModifyMs());