aboutsummaryrefslogtreecommitdiff
path: root/src/form.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/form.cc')
-rw-r--r--src/form.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/form.cc b/src/form.cc
index bf1b12e0..0f125c95 100644
--- a/src/form.cc
+++ b/src/form.cc
@@ -257,18 +257,20 @@ static void Html_add_input(DilloHtml *html, DilloHtmlInputType type,
*/
static DilloHtmlInput *Html_get_radio_input(DilloHtml *html, const char *name)
{
- lout::misc::SimpleVector<DilloHtmlInput*>* inputs;
-
- if (html->InFlags & IN_FORM)
- inputs = html->getCurrentForm()->inputs;
- else
- inputs = html->inputs_outside_form;
-
- for (int idx = 0; idx < inputs->size(); idx++) {
- DilloHtmlInput *input = inputs->get(idx);
- if (input->type == DILLO_HTML_INPUT_RADIO &&
- input->name && !dStrcasecmp(input->name, name))
- return input;
+ if (name) {
+ lout::misc::SimpleVector<DilloHtmlInput*>* inputs;
+
+ if (html->InFlags & IN_FORM)
+ inputs = html->getCurrentForm()->inputs;
+ else
+ inputs = html->inputs_outside_form;
+
+ for (int idx = 0; idx < inputs->size(); idx++) {
+ DilloHtmlInput *input = inputs->get(idx);
+ if (input->type == DILLO_HTML_INPUT_RADIO &&
+ input->name && !dStrcasecmp(input->name, name))
+ return input;
+ }
}
return NULL;
}