Fix bug 33111, crash when creating an applet element from JS, now we no longer crash but dynamically creating applets doesn't work yet.

git-svn-id: svn://10.0.0.236/trunk@70267 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jst%netscape.com 2000-05-17 04:01:57 +00:00
parent 97e9d36acb
commit afd6b8cd47
2 changed files with 20 additions and 12 deletions

View File

@ -320,12 +320,16 @@ if (NS_SUCCEEDED(rv)) {
return rv;
// 2. get the plugin instance corresponding to this element.
nsIPresShell* shell = mInner.mDocument->GetShellAt(0);
if (nsnull == shell)
return NS_ERROR_FAILURE;
nsIFrame* frame = nsnull;
shell->GetPrimaryFrameFor(mInner.mContent, &frame);
NS_RELEASE(shell);
nsIPresShell* shell = nsnull;
if (mInner.mDocument)
shell = mInner.mDocument->GetShellAt(0);
nsIFrame* frame = nsnull;
if (shell) {
shell->GetPrimaryFrameFor(mInner.mContent, &frame);
NS_RELEASE(shell);
}
if(frame != nsnull)
{

View File

@ -320,12 +320,16 @@ if (NS_SUCCEEDED(rv)) {
return rv;
// 2. get the plugin instance corresponding to this element.
nsIPresShell* shell = mInner.mDocument->GetShellAt(0);
if (nsnull == shell)
return NS_ERROR_FAILURE;
nsIFrame* frame = nsnull;
shell->GetPrimaryFrameFor(mInner.mContent, &frame);
NS_RELEASE(shell);
nsIPresShell* shell = nsnull;
if (mInner.mDocument)
shell = mInner.mDocument->GetShellAt(0);
nsIFrame* frame = nsnull;
if (shell) {
shell->GetPrimaryFrameFor(mInner.mContent, &frame);
NS_RELEASE(shell);
}
if(frame != nsnull)
{