From 90cd023a8d57a2cf4e49cb7b027d5f6e2f9f4016 Mon Sep 17 00:00:00 2001 From: "attinasi%netscape.com" Date: Fri, 15 Mar 2002 00:40:07 +0000 Subject: [PATCH] Catch the case where the content node for the Input has not been created yet, prevent crash. b=123914 r=jkeiser, sr=roc+moz, a=asa (OBO drivers) git-svn-id: svn://10.0.0.236/trunk@116604 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsIsIndexFrame.cpp | 3 ++- mozilla/layout/html/forms/src/nsIsIndexFrame.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/forms/nsIsIndexFrame.cpp b/mozilla/layout/forms/nsIsIndexFrame.cpp index 9e72eae5fe4..525617740cb 100644 --- a/mozilla/layout/forms/nsIsIndexFrame.cpp +++ b/mozilla/layout/forms/nsIsIndexFrame.cpp @@ -175,7 +175,8 @@ nsIsIndexFrame::GetInputFrame(nsIPresContext* aPresContext, { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - if (presShell) { + if (!mInputContent) NS_WARNING("null content - cannot restore state"); + if (presShell && mInputContent) { nsIFrame *frame; presShell->GetPrimaryFrameFor(mInputContent, &frame); if (frame) { diff --git a/mozilla/layout/html/forms/src/nsIsIndexFrame.cpp b/mozilla/layout/html/forms/src/nsIsIndexFrame.cpp index 9e72eae5fe4..525617740cb 100644 --- a/mozilla/layout/html/forms/src/nsIsIndexFrame.cpp +++ b/mozilla/layout/html/forms/src/nsIsIndexFrame.cpp @@ -175,7 +175,8 @@ nsIsIndexFrame::GetInputFrame(nsIPresContext* aPresContext, { nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - if (presShell) { + if (!mInputContent) NS_WARNING("null content - cannot restore state"); + if (presShell && mInputContent) { nsIFrame *frame; presShell->GetPrimaryFrameFor(mInputContent, &frame); if (frame) {