Bug 629845 (2/2) - GetRoot() returning null isn't unexpected. r=ehsan a=blocking-final

This commit is contained in:
Mounir Lamouri 2011-02-11 02:01:49 +01:00
parent a2b5d8fea5
commit fd359d7a1c

View File

@ -530,11 +530,14 @@ nsHTMLEditor::BeginningOfDocument()
nsresult res = GetSelection(getter_AddRefs(selection));
NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_TRUE(selection, NS_ERROR_NOT_INITIALIZED);
// get the root element
nsIDOMElement *rootElement = GetRoot();
NS_ENSURE_TRUE(rootElement, NS_ERROR_NULL_POINTER);
// Get the root element.
nsIDOMElement *rootElement = GetRoot();
if (!rootElement) {
NS_WARNING("GetRoot() returned a null pointer (mRootElement is null)");
return NS_OK;
}
// find first editable thingy
PRBool done = PR_FALSE;
nsCOMPtr<nsIDOMNode> curNode(rootElement), selNode;