diff --git a/radio/src/thirdparty/libopenui/src/form.cpp b/radio/src/thirdparty/libopenui/src/form.cpp index f4063f317..592598e5d 100644 --- a/radio/src/thirdparty/libopenui/src/form.cpp +++ b/radio/src/thirdparty/libopenui/src/form.cpp @@ -154,16 +154,19 @@ void FormGroup::onEvent(event_t event) TRACE_WINDOWS("%s received event 0x%X", getWindowDebugString("FormGroup").c_str(), event); if (event == EVT_KEY_BREAK(KEY_ENTER)) { - first->setFocus(SET_FOCUS_FIRST); + if (first) + first->setFocus(SET_FOCUS_FIRST); } else if (event == EVT_KEY_BREAK(KEY_EXIT) && !hasFocus() && !(windowFlags & FORM_FORWARD_FOCUS)) { setFocus(SET_FOCUS_DEFAULT); } else if (event == EVT_ROTARY_RIGHT && !next) { - first->setFocus(SET_FOCUS_FIRST); + if (first) + first->setFocus(SET_FOCUS_FIRST); } else if (event == EVT_ROTARY_LEFT && !previous) { - last->setFocus(SET_FOCUS_FIRST); + if (last) + last->setFocus(SET_FOCUS_FIRST); } else { FormField::onEvent(event);