Commit eeb30dc2 authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

[Multipaste] return if CachedImageModel not found

It should exist, and we assume that it exists.

I'm not sure how it would not exist, but return in this case to
avoid a crash.

Bug: 1138665
Change-Id: I7a667f4e3744f7f5bb580139962b92860f763d5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546853Reviewed-by: default avatarAndrew Xu <andrewxu@chromium.org>
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Auto-Submit: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828924}
parent 145cbe82
......@@ -277,6 +277,8 @@ void ClipboardHistoryResourceManager::OnClipboardHistoryItemRemoved(
cached_image_models_, FindCachedImageModelForItem(item));
DCHECK(cached_image_model != cached_image_models_.end());
if (cached_image_model == cached_image_models_.end())
return;
// Update usages.
base::Erase(cached_image_model->clipboard_history_item_ids, item.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