summaryrefslogtreecommitdiffstats
path: root/docshell/shistory/nsSHEntry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'docshell/shistory/nsSHEntry.cpp')
-rw-r--r--docshell/shistory/nsSHEntry.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/docshell/shistory/nsSHEntry.cpp b/docshell/shistory/nsSHEntry.cpp
index 9d972136f..9d8bf5096 100644
--- a/docshell/shistory/nsSHEntry.cpp
+++ b/docshell/shistory/nsSHEntry.cpp
@@ -416,6 +416,9 @@ nsSHEntry::Create(nsIURI* aURI, const nsAString& aTitle,
uint64_t aDocShellID,
bool aDynamicCreation)
{
+ MOZ_ASSERT(aTriggeringPrincipal,
+ "need a valid triggeringPrincipal to create a session history entry");
+
mURI = aURI;
mTitle = aTitle;
mPostData = aInputStream;
@@ -515,6 +518,10 @@ nsSHEntry::GetTriggeringPrincipal(nsIPrincipal** aTriggeringPrincipal)
NS_IMETHODIMP
nsSHEntry::SetTriggeringPrincipal(nsIPrincipal* aTriggeringPrincipal)
{
+ MOZ_ASSERT(aTriggeringPrincipal, "need a valid triggeringPrincipal");
+ if (!aTriggeringPrincipal) {
+ return NS_ERROR_FAILURE;
+ }
mShared->mTriggeringPrincipal = aTriggeringPrincipal;
return NS_OK;
}