Commit 6fc9231b authored by Sinan Sahin's avatar Sinan Sahin Committed by Commit Bot

[Context menu redesign] Fix null pointer exception

Bug: 987101
Change-Id: I46a33fcad060551b9f6216efab47147b0dfe8baf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1716261Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Sinan Sahin <sinansahin@google.com>
Cr-Commit-Position: refs/heads/master@{#680604}
parent 57803468
...@@ -69,6 +69,12 @@ class RevampedContextMenuHeaderMediator implements View.OnClickListener { ...@@ -69,6 +69,12 @@ class RevampedContextMenuHeaderMediator implements View.OnClickListener {
if (icon == null) { if (icon == null) {
final RoundedIconGenerator iconGenerator = createRoundedIconGenerator(fallbackColor); final RoundedIconGenerator iconGenerator = createRoundedIconGenerator(fallbackColor);
icon = iconGenerator.generateIconForUrl(mPlainUrl); icon = iconGenerator.generateIconForUrl(mPlainUrl);
// generateIconForUrl might return null if the URL is empty or the domain cannot be
// resolved. See https://crbug.com/987101
// TODO(sinansahin): Handle the case where generating an icon fails.
if (icon == null) {
return;
}
} }
final int size = mContext.getResources().getDimensionPixelSize( final int size = mContext.getResources().getDimensionPixelSize(
......
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