From db553ebe8d637335bf1526edf38142870f24721e Mon Sep 17 00:00:00 2001 From: a-bahmani <15884531+a-bahmani@users.noreply.github.com> Date: Mon, 17 Dec 2018 23:42:28 +0330 Subject: [PATCH] Fix null pointer When I am decompiling an apk, I got this exception: Exception in thread "main" java.lang.NullPointerException at brut.androlib.res.data.ResResSpec.(ResResSpec.java:42) --- .../src/main/java/brut/androlib/res/data/ResResSpec.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResResSpec.java b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResResSpec.java index 028b88444e..aef9542718 100755 --- a/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResResSpec.java +++ b/brut.apktool/apktool-lib/src/main/java/brut/androlib/res/data/ResResSpec.java @@ -39,7 +39,7 @@ public ResResSpec(ResID id, String name, ResPackage pkg, ResTypeSpec type) { if (resResSpec != null) { cleanName = name + "_APKTOOL_DUPLICATENAME_" + id.toString(); } else { - cleanName = (name.isEmpty() ? ("APKTOOL_DUMMYVAL_" + id.toString()) : name); + cleanName = ((name == null || name.isEmpty()) ? ("APKTOOL_DUMMYVAL_" + id.toString()) : name); } this.mName = cleanName;