commit | 7ce9f5af9fd29b15e35d55419dad0f0fd0583c7c | [log] [tgz] |
---|---|---|
author | kgui <kgui@google.com> | Mon Dec 25 16:32:17 2023 +0800 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Mon Jan 08 21:20:59 2024 +0000 |
tree | 41bdc8465c9a8d2d66b5637a5d210b1f01e9657f | |
parent | 8d3d8a8c9fee869479cfcf9ff59b87b90204dde5 [diff] |
Throw out a DexFileNotFoundException if the dexFile of a DexEntry is null. Which is consistent with the API's annotation that getDexFile() returns an non-null object. Bug: 317075756 Test: locally via: $ make dist cts-api-coverage (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1706ee3aaffd7675999cad15fb3b1cb72af2ff89) Merged-In: I3cac4bd2dd9c378faa1cf6212f06f495c8fd954b Change-Id: I3cac4bd2dd9c378faa1cf6212f06f495c8fd954b
diff --git a/dexlib2/src/main/java/com/android/tools/smali/dexlib2/DexFileFactory.java b/dexlib2/src/main/java/com/android/tools/smali/dexlib2/DexFileFactory.java index f59b107..786ae4e 100644 --- a/dexlib2/src/main/java/com/android/tools/smali/dexlib2/DexFileFactory.java +++ b/dexlib2/src/main/java/com/android/tools/smali/dexlib2/DexFileFactory.java
@@ -394,7 +394,7 @@ if (exactMatch) { try { MultiDexContainer.DexEntry<? extends DexBackedDexFile> entry = dexContainer.getEntry(targetEntry); - if (entry == null) { + if (entry == null || entry.getDexFile() == null) { throw new DexFileNotFoundException("Could not find entry %s in %s.", targetEntry, filename); } return entry;