Commit e1cb1817 authored by Friedrich Horschig's avatar Friedrich Horschig Committed by Commit Bot

[Mfill][Android] Null-check possibly null window

https://crrev.com/c/2403641 was supposed to prevent a rare crash (see
linked bug 1049090) but DCHECKed the possible nullptr instead of
returning nullptr which only results in a different stacktrace (see
linked bug 1129267).
Since the crash itself shouldn't have become more prominent, a revert
of that CL makes no sense and this upstream fix is sufficient.

Bug: 1049090, 1129267
Change-Id: Iff6b6103439cb39c1cd96a09eb7ec6e0a1b31044
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2414302Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Friedrich [CET] <fhorschig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807870}
parent b131a32a
......@@ -198,11 +198,13 @@ base::android::ScopedJavaGlobalRef<jobject>
ManualFillingViewAndroid::GetOrCreateJavaObject() {
if (java_object_internal_)
return java_object_internal_;
ui::ViewAndroid* view_android = controller_->container_view();
DCHECK(view_android);
if (controller_->container_view() == nullptr ||
controller_->container_view()->GetWindowAndroid() == nullptr) {
return nullptr; // No window attached (yet or anymore).
}
java_object_internal_.Reset(Java_ManualFillingComponentBridge_create(
base::android::AttachCurrentThread(), reinterpret_cast<intptr_t>(this),
view_android->GetWindowAndroid()->GetJavaObject()));
controller_->container_view()->GetWindowAndroid()->GetJavaObject()));
return java_object_internal_;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment