diff --git a/docshell/base/nsWebShell.cpp b/docshell/base/nsWebShell.cpp index 1c4c477d2e5..b011fb44a98 100644 --- a/docshell/base/nsWebShell.cpp +++ b/docshell/base/nsWebShell.cpp @@ -664,7 +664,7 @@ nsWebShell::OnLinkClickSync(nsIContent *aContent, PRBool inherit; nsresult rv = URIInheritsSecurityContext(aURI, &inherit); if (NS_FAILED(rv) || inherit) { - nsCOMPtr sourceDoc = aContent->GetDocument(); + nsCOMPtr sourceDoc = aContent->GetCurrentDoc(); if (!sourceDoc) { // The source is in a 'zombie' document, or not part of a