Fixing nsbeta2+ bug 41588, accessing document.documentElement on an empty document in JS threw a NS_ERROR_FAILURE exception in stead of just returning null. r=heikki@citec.fi

This commit is contained in:
jst%netscape.com 2000-06-16 13:37:46 +00:00
Родитель e8151eee69
Коммит c06191a726
2 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -2058,11 +2058,13 @@ nsDocument::GetDocumentElement(nsIDOMElement** aDocumentElement)
return NS_ERROR_NULL_POINTER;
}
nsresult res = NS_ERROR_FAILURE;
nsresult res = NS_OK;
if (nsnull != mRootContent) {
res = mRootContent->QueryInterface(NS_GET_IID(nsIDOMElement), (void**)aDocumentElement);
NS_ASSERTION(NS_OK == res, "Must be a DOM Element");
} else {
*aDocumentElement = nsnull;
}
return res;

Просмотреть файл

@ -2058,11 +2058,13 @@ nsDocument::GetDocumentElement(nsIDOMElement** aDocumentElement)
return NS_ERROR_NULL_POINTER;
}
nsresult res = NS_ERROR_FAILURE;
nsresult res = NS_OK;
if (nsnull != mRootContent) {
res = mRootContent->QueryInterface(NS_GET_IID(nsIDOMElement), (void**)aDocumentElement);
NS_ASSERTION(NS_OK == res, "Must be a DOM Element");
} else {
*aDocumentElement = nsnull;
}
return res;