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;