Skip to content

Commit 49b815f

Browse files
JinsukKimKrishna Govind
authored and
Krishna Govind
committed
Android: Fix Favicon NPE in accessibility mode
TabFavicon is Tab's UserData which should not be accessed after Tab is destroyed or its WebContent is not ready yet. This CL adds the corresponding check to avoid NPE that occurs when working in accessibility mode, which attempts to access a Tab already destroyed after an animation effect or Tab is not loaded with a new WebContents object. Bug: 940332 Change-Id: If77c0eab251fb0bc728f046605a9f6930187557b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1516116 Reviewed-by: Theresa <[email protected]> Commit-Queue: Jinsuk Kim <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#639735}(cherry picked from commit 01084125cf95d52cf9b06fafcc2eac07098302de) Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1518841 Reviewed-by: Krishna Govind <[email protected]> Cr-Commit-Position: refs/branch-heads/3729@{#56} Cr-Branched-From: d4a8972-refs/heads/master@{#638880}
1 parent 84c6117 commit 49b815f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

chrome/android/java/src/org/chromium/chrome/browser/tab/TabFavicon.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ static TabFavicon from(Tab tab) {
4141
}
4242

4343
private static TabFavicon get(Tab tab) {
44+
if (tab == null || !tab.isInitialized()) return null;
4445
return tab.getUserDataHost().getUserData(USER_DATA_KEY);
4546
}
4647

0 commit comments

Comments
 (0)