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..b0b39f4022853f7f9f63ca8b7b6ba0110a387753 100644 |
| --- a/chrome/browser/icon_loader_win.cc |
| +++ b/chrome/browser/icon_loader_win.cc |
| @@ -42,8 +42,15 @@ 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) { |
| + image_.reset(new gfx::Image(bitmap)); |
| + } else { |
| + LOG(ERROR) << "Decoding HICON for group " << group_ << " failed"; |
|
Peter Kasting
2011/08/26 19:52:56
Nit: TBH, I'm not sure how much use this error log
|
| + image_.reset(); |
| + } |
| target_message_loop_->PostTask(FROM_HERE, |
| NewRunnableMethod(this, &IconLoader::NotifyDelegate)); |