Don't crash if the referenced bind element isn't in the document.
git-svn-id: svn://10.0.0.236/branches/FORMS_20040722_BRANCH@163098 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -79,12 +79,14 @@ nsXFormsControl::GetModelAndBind(nsIDOMElement **aBindElement)
|
||||
nsCOMPtr<nsIContent> bindContent = do_QueryInterface(*aBindElement);
|
||||
nsIContent *modelContent = bindContent;
|
||||
|
||||
while ((modelContent = modelContent->GetParent())) {
|
||||
nsINodeInfo *nodeInfo = modelContent->GetNodeInfo();
|
||||
if (nodeInfo &&
|
||||
nodeInfo->NamespaceEquals(NS_LITERAL_STRING("http://www.w3.org/2002/xforms")) &&
|
||||
nodeInfo->NameAtom() == nsXFormsAtoms::model)
|
||||
break;
|
||||
if (modelContent) {
|
||||
while ((modelContent = modelContent->GetParent())) {
|
||||
nsINodeInfo *nodeInfo = modelContent->GetNodeInfo();
|
||||
if (nodeInfo &&
|
||||
nodeInfo->NamespaceEquals(NS_LITERAL_STRING("http://www.w3.org/2002/xforms")) &&
|
||||
nodeInfo->NameAtom() == nsXFormsAtoms::model)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
modelWrapper = do_QueryInterface(modelContent);
|
||||
|
||||
Reference in New Issue
Block a user