From 5edee8c807167c61b1f97cb5a9a69534fd839b00 Mon Sep 17 00:00:00 2001 From: "darin%meer.net" Date: Tue, 7 Dec 2004 19:33:12 +0000 Subject: [PATCH] fixes bug 272122 "Crash in xf:output" patch by smaug@welho.com r=darin --- extensions/xforms/nsXFormsOutputElement.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/extensions/xforms/nsXFormsOutputElement.cpp b/extensions/xforms/nsXFormsOutputElement.cpp index d52ec685a32..5b44f0b25d9 100755 --- a/extensions/xforms/nsXFormsOutputElement.cpp +++ b/extensions/xforms/nsXFormsOutputElement.cpp @@ -259,15 +259,16 @@ nsXFormsOutputElement::Refresh() if (hasRef) { nsCOMPtr resultNode; - result->GetSingleNodeValue(getter_AddRefs(resultNode)); - nsXFormsUtils::GetNodeValue(resultNode, text); + rv = result->GetSingleNodeValue(getter_AddRefs(resultNode)); + if (resultNode) + nsXFormsUtils::GetNodeValue(resultNode, text); } else { rv = result->GetStringValue(text); - NS_ENSURE_SUCCESS(rv, rv); } + NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr dom3Node = do_QueryInterface(mHTMLElement); - NS_ENSURE_TRUE(mHTMLElement, NS_ERROR_FAILURE); + NS_ENSURE_STATE(dom3Node); rv = dom3Node->SetTextContent(text); NS_ENSURE_SUCCESS(rv, rv); }