Fix bug introduced in https://android-review.googlesource.com/102610.
Also make oatdump work again.
Change-Id: Iab96971645f40585bc04769d410f2273d3977f51
diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc
index 7d9922d..50dfe21 100644
--- a/runtime/oat_file.cc
+++ b/runtime/oat_file.cc
@@ -534,7 +534,9 @@
methods_pointer_index = num_set_bits;
}
const OatMethodOffsets& oat_method_offsets = methods_pointer_[methods_pointer_index];
- if (oat_file_->IsExecutable() || Runtime::Current()->IsCompiler()) {
+ if (oat_file_->IsExecutable()
+ || (Runtime::Current() == nullptr)
+ || Runtime::Current()->IsCompiler()) {
return OatMethod(
oat_file_->Begin(),
oat_method_offsets.code_offset_,