diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp
index 0b0d27c1c03..f31857a95d7 100644
--- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp
+++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp
@@ -1565,9 +1565,10 @@ SinkContext::OpenContainer(const nsIParserNode& aNode)
// Create new container content object
nsHTMLTag nodeType = nsHTMLTag(aNode.GetNodeType());
nsIHTMLContent* content;
+ nsIDocShell *docShell = nsnull;
+ if (mSink->mFrameset) docshell = (nsIDocShell *) mSink->mDocShell;
rv = mSink->CreateContentObject(aNode, nodeType, mSink->mCurrentForm,
- mSink->mFrameset ? mSink->mDocShell : nsnull,
- &content);
+ docshell, &content);
NS_ENSURE_SUCCESS(rv, rv);
mStack[mStackPos].mType = nodeType;