Skip to content

Commit

Permalink
fix(deobf): resolve NPE when package is empty (if rename is disabled)
Browse files Browse the repository at this point in the history
  • Loading branch information
skylot committed Apr 26, 2020
1 parent 8319662 commit e3f388a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions jadx-core/src/main/java/jadx/core/deobf/PackageNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,17 @@ public String getName() {
public String getFullName() {
if (cachedPackageFullName == null) {
Deque<PackageNode> pp = getParentPackages();

StringBuilder result = new StringBuilder();
result.append(pp.pop().getName());
while (!pp.isEmpty()) {
result.append(SEPARATOR_CHAR);
if (pp.isEmpty()) {
cachedPackageFullName = "";
} else {
StringBuilder result = new StringBuilder();
result.append(pp.pop().getName());
while (!pp.isEmpty()) {
result.append(SEPARATOR_CHAR);
result.append(pp.pop().getName());
}
cachedPackageFullName = result.toString();
}
cachedPackageFullName = result.toString();
}
return cachedPackageFullName;
}
Expand Down

0 comments on commit e3f388a

Please # to comment.