зеркало из https://github.com/mozilla/gecko-dev.git
Check to make sure that you have content in the doc before doing GetElementById(). (This was causing crash in SearchForNodeByID() -- thanks to law@netscape.com for the fix.)
This commit is contained in:
Родитель
3a965e5a62
Коммит
4293358b74
|
@ -2321,6 +2321,10 @@ XULDocumentImpl::GetRdf(nsIRDFService** aRDFService)
|
|||
NS_IMETHODIMP
|
||||
XULDocumentImpl::GetElementById(const nsString& aId, nsIDOMElement** aReturn)
|
||||
{
|
||||
NS_PRECONDITION(mRootContent != nsnull, "document contains no content");
|
||||
if (! mRootContent)
|
||||
return NS_ERROR_NOT_INITIALIZED; // XXX right error code?
|
||||
|
||||
nsresult rv;
|
||||
|
||||
nsAutoString uri(aId);
|
||||
|
|
|
@ -2321,6 +2321,10 @@ XULDocumentImpl::GetRdf(nsIRDFService** aRDFService)
|
|||
NS_IMETHODIMP
|
||||
XULDocumentImpl::GetElementById(const nsString& aId, nsIDOMElement** aReturn)
|
||||
{
|
||||
NS_PRECONDITION(mRootContent != nsnull, "document contains no content");
|
||||
if (! mRootContent)
|
||||
return NS_ERROR_NOT_INITIALIZED; // XXX right error code?
|
||||
|
||||
nsresult rv;
|
||||
|
||||
nsAutoString uri(aId);
|
||||
|
|
Загрузка…
Ссылка в новой задаче