Commit 08ced4e0 authored by Sahel Sharify's avatar Sahel Sharify Committed by Commit Bot

[Payment] Safe access icon_bitmap->width()

Bug: 1098881
Change-Id: Ic1a9a78731c9cf7c4c939578a966233f4e187a42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343144Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Commit-Queue: Sahel Sharify <sahel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#796119}
parent 9cac8c44
......@@ -145,7 +145,7 @@ class ReadOnlyOriginView : public views::View {
views::GridLayout::LEADING, views::GridLayout::CENTER, 1.0,
views::GridLayout::ColumnSize::kUsePreferred, 0, 0);
const bool has_icon = icon_bitmap && !icon_bitmap->drawsNothing();
float adjusted_width = base::checked_cast<float>(icon_bitmap->width());
float adjusted_width = base::checked_cast<float>(has_icon ? icon_bitmap->width() : 0);
if (has_icon) {
adjusted_width =
adjusted_width *
......
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