Skip to content

Commit

Permalink
Bug 1667035 - Crash in [@ mozilla::dom::CanonicalBrowsingContext::Rem…
Browse files Browse the repository at this point in the history
…oveDynEntriesFromActiveSessionHistoryEntry], r=jesup

Differential Revision: https://phabricator.services.mozilla.com/D91632
  • Loading branch information
Olli Pettay authored and Olli Pettay committed Sep 29, 2020
1 parent a15467b commit afc67e4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docshell/base/CanonicalBrowsingContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,9 @@ void CanonicalBrowsingContext::ReplaceActiveSessionHistoryEntry(

void CanonicalBrowsingContext::RemoveDynEntriesFromActiveSessionHistoryEntry() {
nsISHistory* shistory = GetSessionHistory();
// In theory shistory can be null here if the method is called right after
// CanonicalBrowsingContext::ReplacedBy call.
NS_ENSURE_TRUE_VOID(shistory);
nsCOMPtr<nsISHEntry> root = nsSHistory::GetRootSHEntry(mActiveEntry);
shistory->RemoveDynEntries(shistory->GetIndexOfEntry(root), mActiveEntry);
}
Expand Down

0 comments on commit afc67e4

Please sign in to comment.