Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-26141] Android: Prevent lookup of invalid reference key #10129

Merged
merged 5 commits into from
Jun 26, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/runtime/v8/src/native/JavaObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ jobject JavaObject::getJavaObject()
}
if (useGlobalRefs) {
return javaObject_;
} else {
ASSERT(refTableKey_ != 0);
} else if (refTableKey_ > 0) {
jobject ref = ReferenceTable::getReference(refTableKey_);
if (ref == NULL) {
// Sanity check. Did we get into a state where it was weak on Java, got GC'd but the C++ proxy didn't get deleted yet?
LOGE(TAG, "!!! OH NO! We tried to grab a Java Object back out of the reference table, but it must have been GC'd, because it's null! Key: %d", refTableKey_);
}
return ref;
}
return NULL;
}

void JavaObject::unreferenceJavaObject(jobject ref) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ public Activity getRootOrCurrentActivity()
}
}

Log.e(TAG, "No valid root or current activity found for application instance");
return null;
}

Expand Down