Bug 1453567 - Null-check rootSH in nsDocShell::AddState. r=bz, a=RyanVM

Looks like this accidentally got thrown out in the refactoring.
This commit is contained in:
Nika Layzell
2018-04-16 12:57:00 -04:00
parent b60b296605
commit 6e21ea5817

View File

@@ -11854,6 +11854,8 @@ nsDocShell::AddState(JS::Handle<JS::Value> aData, const nsAString& aTitle,
// call ReplaceEntry so that we notify nsIHistoryListeners that an entry
// was replaced.
RefPtr<ChildSHistory> rootSH = GetRootSessionHistory();
NS_ENSURE_TRUE(rootSH, NS_ERROR_UNEXPECTED);
if (!aReplace) {
int32_t curIndex = rootSH->Index();
if (curIndex > -1) {