fix: check first before derefering it

This commit is contained in:
Raphael Coeffic
2022-06-11 15:13:11 +02:00
committed by Raphael Coeffic
parent cc41043883
commit 6cb2e332e1
+2 -1
View File
@@ -312,7 +312,8 @@ void FormGroup::setFocus(uint8_t flag, Window * from)
case SET_FOCUS_FORWARD:
if (from && from->isChild(this)) {
if (next == this) {
first->setFocus(SET_FOCUS_FORWARD, this);
if (first)
first->setFocus(SET_FOCUS_FORWARD, this);
}
else if (next) {
next->setFocus(SET_FOCUS_FORWARD, this);