Fix NewLocalRef, NewGlobalRef to handle cleared weak globals.
We were not checking for null after decoding the reference, this
meant that we incorrectly created null weak global references instead
of returning null.
Issue: 63929
Change-Id: I9159682e6edad8f415ef8144fc13b9aedd2cceb4
diff --git a/runtime/thread.cc b/runtime/thread.cc
index bc252de..9faa60d 100644
--- a/runtime/thread.cc
+++ b/runtime/thread.cc
@@ -1147,7 +1147,7 @@
result = Runtime::Current()->GetJavaVM()->DecodeWeakGlobal(const_cast<Thread*>(this), ref);
if (result == kClearedJniWeakGlobal) {
// This is a special case where it's okay to return NULL.
- return NULL;
+ return nullptr;
}
}