Commit e07a406b authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Commit Bot

Android: Fix NPE in Preview Tab

WebContentsObserver.didFinishNavigation that PreviewTab is listening
to can come before its views are ready. This CL stops updating
caption in such case to prevent NPE reported in the bug.

Bug: 1020888
Change-Id: I9240e32015e0df631c3b80546c99d8e9e0a97c5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1898152Reviewed-by: default avatarDonn Denman <donnd@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712408}
parent 300872bc
...@@ -147,6 +147,7 @@ public class EphemeralTabCaptionControl extends OverlayPanelTextViewInflater { ...@@ -147,6 +147,7 @@ public class EphemeralTabCaptionControl extends OverlayPanelTextViewInflater {
* @param text String to use for caption. * @param text String to use for caption.
*/ */
public void setCaptionText(String text) { public void setCaptionText(String text) {
if (mCaption == null) return;
mCaption.setText(text); mCaption.setText(text);
invalidate(); invalidate();
} }
......
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