if (!dom || !jqualifiedName || ! jpublicID || jsystemID) {
if (!dom || !jqualifiedName || !jpublicID || !jsystemID) {
JNIEXPORT jobject JNICALL Java_org_mozilla_dom_DOMImplementationImpl_createDocumentType  (JNIEnv *env, jobject jthis, jstring jqualifiedName, jstring jpublicID, jstring jsystemID){  nsIDOMDOMImplementation* dom = (nsIDOMDOMImplementation*)     env->GetLongField(jthis, JavaDOMGlobals::domImplementationPtrFID);  if (!dom || !jqualifiedName || ! jpublicID || jsystemID) {    JavaDOMGlobals::ThrowException(env,	"DOMImplementation.createDocumentType: NULL pointer");    return NULL;  }  nsString* qualifiedName = JavaDOMGlobals::GetUnicode(env, jqualifiedName);  if (!qualifiedName)      return NULL;  nsString* publicID = JavaDOMGlobals::GetUnicode(env, jpublicID);  if (!publicID) {      nsString::Recycle(qualifiedName);      return NULL;  }  nsString* systemID = JavaDOMGlobals::GetUnicode(env, jsystemID);  if (!systemID) {      nsString::Recycle(qualifiedName);      nsString::Recycle(publicID);      return NULL;  }  nsIDOMDocumentType* docType = nsnull;  nsresult rv = dom->CreateDocumentType(*qualifiedName, *publicID, *systemID, &docType);  nsString::Recycle(qualifiedName);  nsString::Recycle(publicID);  nsString::Recycle(systemID);  if (NS_FAILED(rv)) {      JavaDOMGlobals::ExceptionType exceptionType = JavaDOMGlobals::EXCEPTION_RUNTIME;      if (NS_ERROR_GET_MODULE(rv) == NS_ERROR_MODULE_DOM &&	  (rv == NS_ERROR_DOM_INVALID_CHARACTER_ERR ||	   rv == NS_ERROR_DOM_NAMESPACE_ERR)) {	  exceptionType = JavaDOMGlobals::EXCEPTION_DOM;      }      JavaDOMGlobals::ThrowException(env,	  "DOMImplementation.createDocumentType: failed", rv, exceptionType);      return NULL;  }  return JavaDOMGlobals::CreateNodeSubtype(env, (nsIDOMNode*)docType);}