Do not attempt to unregister null oat files

The oat file in the DexFile array may be null if we are running
without dex2oat.

Bug: 22720414
Change-Id: Ie1014b740caa77c3484a1671f29edb42bcc746c0
diff --git a/runtime/native/dalvik_system_DexFile.cc b/runtime/native/dalvik_system_DexFile.cc
index 1a6bead..e9ce02b 100644
--- a/runtime/native/dalvik_system_DexFile.cc
+++ b/runtime/native/dalvik_system_DexFile.cc
@@ -230,7 +230,8 @@
     }
   }
 
-  if (all_deleted) {
+  // oat_file can be null if we are running without dex2oat.
+  if (all_deleted && oat_file != nullptr) {
     // If all of the dex files are no longer in use we can unmap the corresponding oat file.
     VLOG(class_linker) << "Unregistering " << oat_file;
     runtime->GetOatFileManager().UnRegisterAndDeleteOatFile(oat_file);