diff options
author | David Srbecky <dsrbecky@google.com> | 2024-02-01 12:04:24 +0000 |
---|---|---|
committer | David Srbecky <dsrbecky@google.com> | 2024-02-01 12:04:24 +0000 |
commit | 1a1bad37d28e963042e8c62af799f592edd72892 (patch) | |
tree | e0fa17261d2eb7418ff78bf72c627553398d29fe | |
parent | ec829c11593567695ca4143c67fe67c1d5d4050b (diff) | |
download | google-smali-1a1bad37d28e963042e8c62af799f592edd72892.tar.gz |
Fix return value of ZipDexContainer.getEntry
Fix regression from the previous CL.
As per the comment, if dex file isn't found, it should return null,
instead DexEntry with null dexFile content.
Change-Id: I765177d221749890493b1d36f94889fed7f76f90
-rw-r--r-- | dexlib2/src/main/java/com/android/tools/smali/dexlib2/dexbacked/ZipDexContainer.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/dexlib2/src/main/java/com/android/tools/smali/dexlib2/dexbacked/ZipDexContainer.java b/dexlib2/src/main/java/com/android/tools/smali/dexlib2/dexbacked/ZipDexContainer.java index ae8688fc..31d115cc 100644 --- a/dexlib2/src/main/java/com/android/tools/smali/dexlib2/dexbacked/ZipDexContainer.java +++ b/dexlib2/src/main/java/com/android/tools/smali/dexlib2/dexbacked/ZipDexContainer.java @@ -122,11 +122,14 @@ public class ZipDexContainer implements MultiDexContainer<DexBackedDexFile> { * Loads a dex file from a specific named entry. * * @param entryName The name of the entry - * @return A ZipDexFile, or null if there is no entry with the given name + * @return A DexEntry, or null if there is no entry with the given name * @throws NotADexFile If the entry isn't a dex file */ @Nullable @Override public DexEntry<DexBackedDexFile> getEntry(@Nonnull String entryName) throws IOException { DexFile dexFile = getEntries().get(entryName); + if (dexFile == null) { + return null; + } return new DexEntry() { @Nonnull @Override |