Prevent crash on focus change when no valid next control has been found.
Fixes the crash discussed in #6714.
(cherry picked from commit 8dd026e4f9
)
This commit is contained in:
parent
cf427eeb7a
commit
0462bf01a2
1 changed files with 5 additions and 5 deletions
|
@ -1688,11 +1688,11 @@ Control *Control::find_next_valid_focus() const {
|
|||
|
||||
if (next_child==this) // no next control->
|
||||
return (get_focus_mode()==FOCUS_ALL)?next_child:NULL;
|
||||
|
||||
if (next_child->get_focus_mode()==FOCUS_ALL)
|
||||
return next_child;
|
||||
|
||||
from = next_child;
|
||||
if (next_child) {
|
||||
if (next_child->get_focus_mode()==FOCUS_ALL)
|
||||
return next_child;
|
||||
from = next_child;
|
||||
} else break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in a new issue