diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/APKResourceImporter.java b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/APKResourceImporter.java index fb7c6faf..415191fc 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/APKResourceImporter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/resources/importing/impl/APKResourceImporter.java @@ -56,7 +56,7 @@ public class APKResourceImporter implements Importer container.resourceFiles = JarUtils.loadResources(decodedResources); } - Objects.requireNonNull(container.resourceFiles).putAll(JarUtils.loadResources(tempCopy)); //copy and rename + container.resourceFiles.putAll(JarUtils.loadResources(tempCopy)); // copy and rename // to prevent unicode filenames String name = MiscUtils.getRandomizedName() + ".jar"; diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/JarUtils.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/JarUtils.java index bd7a37fb..62565995 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/JarUtils.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/JarUtils.java @@ -201,7 +201,7 @@ public class JarUtils */ public static Map loadResources(final File zipFile) throws IOException { if (!zipFile.exists()) - return null; //just ignore + return new LinkedHashMap<>(); // just ignore (don't return null for null-safety!) Map files = new LinkedHashMap<>();