Chromium Code Reviews| Index: chrome/browser/icon_loader_win.cc |
| diff --git a/chrome/browser/icon_loader_win.cc b/chrome/browser/icon_loader_win.cc |
| index eeeedb0efe654fb89e256936379a5e7451075f31..09e6513824d23003dab7534eebe2d1eec6009112 100644 |
| --- a/chrome/browser/icon_loader_win.cc |
| +++ b/chrome/browser/icon_loader_win.cc |
| @@ -42,9 +42,16 @@ void IconLoader::ReadIcon() { |
| DCHECK(r); |
| gfx::Size icon_size(bitmap_info.bmWidth, bitmap_info.bmHeight); |
| - image_.reset(new gfx::Image( |
| - IconUtil::CreateSkBitmapFromHICON(file_info.hIcon, icon_size))); |
| + const SkBitmap* bitmap = |
| + IconUtil::CreateSkBitmapFromHICON(file_info.hIcon, icon_size); |
| + if (!bitmap) { |
| + LOG(ERROR) << "Decoding HICON for group " << group_ << " failed"; |
| + // Don't create a gfx::Image and crash. The delegate won't be notified. |
|
Peter Kasting
2011/08/26 18:12:56
Should we instead set |image_| to a non-NULL but z
Robert Sesek
2011/08/26 19:38:28
No, we should actually notify with a NULL pointer,
|
| + return; |
| + } |
| + |
| + image_.reset(new gfx::Image(bitmap)); |
| target_message_loop_->PostTask(FROM_HERE, |
| NewRunnableMethod(this, &IconLoader::NotifyDelegate)); |
| } |