diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/form.cc | 26 |
2 files changed, 15 insertions, 12 deletions
@@ -34,6 +34,7 @@ dillo-2.2 [??] - Fix scrolling for text search. - Added 'save' key action (not bound by default). - Tooltips + - Fix segfault when radio button lacks name attribute. Patches: corvid +- Support for the letter-spacing property. Patch: Johannes Hofmann, corvid 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; } |