Add some null checks in case of OOME.
Test: test.py
Bug: 194471075
Change-Id: Ib02845636af4d3944a96f001e5ad728a94832285
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 9d9b94a..5e6ae1a 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -9330,7 +9330,9 @@
Handle<mirror::MethodType> type = hs.NewHandle(
mirror::MethodType::Create(self, return_type, method_params));
- dex_cache->SetResolvedMethodType(proto_idx, type.Get());
+ if (type != nullptr) {
+ dex_cache->SetResolvedMethodType(proto_idx, type.Get());
+ }
return type.Get();
}