In some cases the mForm pointer doesn't get set because of the way the content can be constructed

and added via the DOM. So before it is used try to find and set its value again.
Bug 62799 r=harishd sr=attinasi
This commit is contained in:
rods%netscape.com 2001-02-22 11:33:57 +00:00
Родитель a3cf89f1ea
Коммит bfc3f0269a
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -3828,6 +3828,15 @@ nsGenericHTMLLeafFormElement::GetForm(nsIDOMHTMLFormElement** aForm)
NS_ENSURE_ARG_POINTER(aForm);
*aForm = nsnull;
// This is here because radios can be created via script
// and depending on how the content in the script is constructed
// none of the code paths that set up the mForm may get called
// So this is a last stab effort to get the form before somebody
// uses the radiobutton. Bug 62799
if (mForm == nsnull) {
FindFormParent(mParent, this); // ignore returned result
}
if (mForm) {
mForm->QueryInterface(NS_GET_IID(nsIDOMHTMLFormElement), (void**)aForm);
}