Bug 656354 - Guard against null pointer dereference in nsDocShell::SetDocCurrentStateObject. r=sicking

--HG--
extra : rebase_source : 74ea820470f5bf8f11d9d61ecfa7dc93207fa3fc
This commit is contained in:
Justin Lebar 2011-05-17 16:25:06 -04:00
Родитель 926b98c09a
Коммит 16b82d4db6
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -7756,8 +7756,12 @@ nsDocShell::SetDocCurrentStateObj(nsISHEntry *shEntry)
NS_ENSURE_TRUE(document, NS_ERROR_FAILURE);
nsCOMPtr<nsIStructuredCloneContainer> scContainer;
nsresult rv = shEntry->GetStateData(getter_AddRefs(scContainer));
NS_ENSURE_SUCCESS(rv, rv);
if (shEntry) {
nsresult rv = shEntry->GetStateData(getter_AddRefs(scContainer));
NS_ENSURE_SUCCESS(rv, rv);
// If shEntry is null, just set the document's state object to null.
}
// It's OK for scContainer too be null here; that just means there's no
// state data associated with this history entry.