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..cd2a36b45c6308e8e1949f62530898526a4540ea 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. |
+ CHECK((*it)->window()); |
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 != browsers_to_close.end(); ++it) { |
+ // TODO(mlerman): If reproducible, determine cause if window() being null. |
+ CHECK((*it)); |
+ CHECK((*it)->window()); |
(*it)->window()->Close(); |
+ } |
} |
// static |