diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 728f009f7446..3627de1aeb88 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -6440,8 +6440,12 @@ nsDocShell::AddToGlobalHistory(nsIChannel* aChannel, nsIURI * aURI, PRBool aHidd if (NS_SUCCEEDED(rv)) { nsCOMPtr browserHistory = do_QueryInterface(mGlobalHistory); - browserHistory->OutputReferrerURL(spec.get(), - referrerSpec.get()); + // In embedding environments, the "lite" global history + // implementation might not implement nsIBrowserHistory. + if (browserHistory) { + browserHistory->OutputReferrerURL(spec.get(), + referrerSpec.get()); + } } } }