Commit 3a38d447 authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Commit Bot

Fix double-callback-call crash in //chrome/browser/ui/webui/new_tab_page/

Fix use-after-move (potential) bugs found by the
"bugprone-use-after-move" clang-tidy check.

Bug: 1122844
Change-Id: Ib68aa86d6ea08ab6febdd61d768dcc151d0a2906
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2431669Reviewed-by: default avatarTibor Goldschwendt <tiborg@chromium.org>
Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810929}
parent 14ba7a6f
...@@ -1198,6 +1198,7 @@ void NewTabPageHandler::OnCollectionImagesAvailable() { ...@@ -1198,6 +1198,7 @@ void NewTabPageHandler::OnCollectionImagesAvailable() {
std::vector<new_tab_page::mojom::CollectionImagePtr> images; std::vector<new_tab_page::mojom::CollectionImagePtr> images;
if (ntp_background_service_->collection_images().empty()) { if (ntp_background_service_->collection_images().empty()) {
std::move(background_images_callback_).Run(std::move(images)); std::move(background_images_callback_).Run(std::move(images));
return;
} }
auto collection_id = auto collection_id =
ntp_background_service_->collection_images()[0].collection_id; ntp_background_service_->collection_images()[0].collection_id;
......
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