Commit 8c3fa7b9 authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

Fix crash in ContentViewCore.onRotationChanged

Reporte crash can happen if |ContentViewCore.onRotationChanged| is called
after CVC is destroyed, therefore mWebContents is set to null. Added
null check against the variable to prevent crash.

Bug: 808971
Change-Id: I7719d2d0c26b36b94eeff406d655512111e58c2d
Reviewed-on: https://chromium-review.googlesource.com/903342Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534835}
parent bc68bfa1
...@@ -1126,9 +1126,11 @@ public class ContentViewCoreImpl ...@@ -1126,9 +1126,11 @@ public class ContentViewCoreImpl
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M
&& getSelectionPopupController().isActionModeValid()) { && getSelectionPopupController().isActionModeValid()) {
hidePopupsAndPreserveSelection(); hidePopupsAndPreserveSelection();
getSelectionPopupController().showActionModeOrClearOnFailure(); if (mWebContents != null) {
getSelectionPopupController().showActionModeOrClearOnFailure();
}
} }
getTextSuggestionHost().hidePopups(); if (mWebContents != null) getTextSuggestionHost().hidePopups();
int rotationDegrees = 0; int rotationDegrees = 0;
switch (rotation) { switch (rotation) {
......
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