зеркало из https://github.com/mozilla/gecko-dev.git
Don't crash if someone pretends to be a form control (via XBL) without implementing
nsIFormControl. Bug 260922, r+sr=jst
This commit is contained in:
Родитель
ec050b1d80
Коммит
61feb80622
|
@ -356,7 +356,12 @@ PRInt32
|
|||
nsFormControlHelper::GetType(nsIContent* aContent)
|
||||
{
|
||||
nsCOMPtr<nsIFormControl> formControl(do_QueryInterface(aContent));
|
||||
return formControl->GetType();
|
||||
if (formControl) {
|
||||
return formControl->GetType();
|
||||
}
|
||||
|
||||
NS_ERROR("Form control not implementing nsIFormControl, assuming TEXT type");
|
||||
return NS_FORM_INPUT_TEXT;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -356,7 +356,12 @@ PRInt32
|
|||
nsFormControlHelper::GetType(nsIContent* aContent)
|
||||
{
|
||||
nsCOMPtr<nsIFormControl> formControl(do_QueryInterface(aContent));
|
||||
return formControl->GetType();
|
||||
if (formControl) {
|
||||
return formControl->GetType();
|
||||
}
|
||||
|
||||
NS_ERROR("Form control not implementing nsIFormControl, assuming TEXT type");
|
||||
return NS_FORM_INPUT_TEXT;
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
Загрузка…
Ссылка в новой задаче