From 2dbf0203f9ca61119b10026d191a045cb60450ce Mon Sep 17 00:00:00 2001 From: "ashuk%eng.sun.com" Date: Tue, 22 May 2001 23:53:42 +0000 Subject: [PATCH] Bug=45018 author=ashuk Files modified jni/org_mozilla_dom_DocumentImpl.cpp This fix makes sure that corner case where call to nsIDOMDocument::CreateEntityReference returns NS_OK, but a null return value for the nsIDOMEntityReference is handled properly thro the exception handling mechanism. git-svn-id: svn://10.0.0.236/trunk@95735 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/java/dom/jni/org_mozilla_dom_DocumentImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mozilla/java/dom/jni/org_mozilla_dom_DocumentImpl.cpp b/mozilla/java/dom/jni/org_mozilla_dom_DocumentImpl.cpp index 778e4c10a9e..ef6e4f20f68 100644 --- a/mozilla/java/dom/jni/org_mozilla_dom_DocumentImpl.cpp +++ b/mozilla/java/dom/jni/org_mozilla_dom_DocumentImpl.cpp @@ -315,7 +315,7 @@ JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DocumentImpl_createEntityReferenc nsresult rv = doc->CreateEntityReference(*name, &ret); nsMemory::Free(name); - if (NS_FAILED(rv)) { + if (NS_FAILED(rv) || ret == nsnull) { JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME; if (NS_ERROR_GET_MODULE(rv) == NS_ERROR_MODULE_DOM && (rv == NS_ERROR_DOM_INVALID_CHARACTER_ERR ||