Chromium Code Reviews| Index: chrome/browser/ui/browser_list.cc |
| diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc |
| index 851a9f8ca791e33639009faadca239dc3ef2017c..4cf87982070641ec8d2345976920197a278086dd 100644 |
| --- a/chrome/browser/ui/browser_list.cc |
| +++ b/chrome/browser/ui/browser_list.cc |
| @@ -151,6 +151,9 @@ void BrowserList::TryToCloseBrowserList(const BrowserVector& browsers_to_close, |
| const base::FilePath& profile_path) { |
| for (BrowserVector::const_iterator it = browsers_to_close.begin(); |
| it != browsers_to_close.end(); ++it) { |
| + // TODO(mlerman): crbug.com/423229, if we can determine why window() is |
| + // false we can better solve the underlying issue here. |
| + DCHECK((*it)->window()); |
|
Peter Kasting
2014/10/30 03:07:50
I would change these two DCHECKs to CHECKs if you'
|
| if ((*it)->CallBeforeUnloadHandlers( |
| base::Bind(&BrowserList::PostBeforeUnloadHandlers, |
| browsers_to_close, |
| @@ -163,8 +166,12 @@ void BrowserList::TryToCloseBrowserList(const BrowserVector& browsers_to_close, |
| on_close_success.Run(profile_path); |
| for (BrowserVector::const_iterator it = browsers_to_close.begin(); |
| - it != browsers_to_close.end(); ++it) |
| - (*it)->window()->Close(); |
| + it != browsers_to_close.end(); ++it) { |
| + // TODO(mlerman): If reproducible, determine cause if window() being null. |
| + DCHECK((*it)->window()); |
| + if ((*it)->window()) |
| + (*it)->window()->Close(); |
| + } |
| } |
| // static |