Commit 243e6cd1 authored by Melissa Zhang's avatar Melissa Zhang Committed by Chromium LUCI CQ

[Sharesheet] Add nullcheck before callback.

We are adding a nullcheck before the callback because callers
may call ShowBubble with NullCallback.

Bug: 1142706
Change-Id: I2d3c1376b036057a2e5890e20a10f6478d5c7075
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2589139
Commit-Queue: Melissa Zhang <melzhang@chromium.org>
Auto-Submit: Melissa Zhang <melzhang@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836527}
parent fba2b00c
......@@ -31,7 +31,9 @@ void SharesheetServiceDelegate::ShowBubble(
sharesheet::CloseCallback close_callback) {
if (is_bubble_open_) {
// TODO(melzhang@) Update by adding SharesheetAlreadyOpenCancel.
std::move(close_callback).Run(sharesheet::SharesheetResult::kCancel);
if (close_callback) {
std::move(close_callback).Run(sharesheet::SharesheetResult::kCancel);
}
return;
}
sharesheet_bubble_view_->ShowBubble(std::move(targets), std::move(intent),
......
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