Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Unified Diff: components/suggestions/image_manager.cc

Issue 689993004: [Suggestions Component] Add missing NULL check to ImageManager::OnImageFetched(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/suggestions/image_fetcher_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/suggestions/image_manager.cc
diff --git a/components/suggestions/image_manager.cc b/components/suggestions/image_manager.cc
index 6e29ddb29f7535461736a75103f2bfde3f6ca8a2..2837e632bae4cc0c2174377d885fc840755031f4 100644
--- a/components/suggestions/image_manager.cc
+++ b/components/suggestions/image_manager.cc
@@ -66,10 +66,12 @@ void ImageManager::GetImageForURL(
}
void ImageManager::OnImageFetched(const GURL& url, const SkBitmap* bitmap) {
- SaveImage(url, *bitmap);
+ if (bitmap) // |bitmap| can be nullptr if image fetch was unsuccessful.
+ SaveImage(url, *bitmap);
}
bool ImageManager::GetImageURL(const GURL& url, GURL* image_url) {
+ DCHECK(image_url);
std::map<GURL, GURL>::iterator it = image_url_map_.find(url);
if (it == image_url_map_.end()) return false; // Not found.
*image_url = it->second;
« no previous file with comments | « components/suggestions/image_fetcher_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698