add first-window case - when the window with the new title hasn't been seen, add it to the hashtable

This commit is contained in:
alecf%netscape.com 2002-06-17 23:46:29 +00:00
parent 07bd7dd42b
commit e83eaff6cf

View File

@ -159,6 +159,12 @@ nsWindowDataSource::OnWindowTitleChange(nsIXULWindow *window,
nsCOMPtr<nsISupports> sup =
dont_AddRef(mWindowResources.Get(&key));
// oops, make sure this window is in the hashtable!
if (!sup) {
OnOpenWindow(window);
sup = dont_AddRef(mWindowResources.Get(&key));
}
NS_ENSURE_TRUE(sup, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIRDFResource> windowResource =