Bug 798446 - Attempt to fix startup crash in nsGlobalWindow ctor. r=bz

This commit is contained in:
Mounir Lamouri 2012-11-27 18:29:49 +00:00
parent 3cc318fdfa
commit 62080f8d1a

View File

@ -732,7 +732,10 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
NS_ASSERTION(sWindowsById, "Windows hash table must be created!");
NS_ASSERTION(!sWindowsById->Get(mWindowID),
"This window shouldn't be in the hash table yet!");
sWindowsById->Put(mWindowID, this);
// We seem to see crashes in release builds because of null |sWindowsById|.
if (sWindowsById) {
sWindowsById->Put(mWindowID, this);
}
mEventTargetObjects.Init();
}