fixing error handling when focus list is empty
This commit is contained in:
parent
c31778b314
commit
2ae327339b
|
|
@ -53,10 +53,11 @@ func pass_focus_to(target:Object) -> bool:
|
|||
push_error("Focus instance not valid")
|
||||
elif !"has_focus" in target:
|
||||
push_error(target, " has no has focus method.")
|
||||
if focus_list.front() == target:
|
||||
push_warning(target, " is already target. Abort passing focus.")
|
||||
if focus_list.size() > 0:
|
||||
if focus_list.front() == target:
|
||||
push_warning(target, " is already target. Abort passing focus.")
|
||||
else:
|
||||
if not focus_list.front() == null: focus_list.front().has_focus = false
|
||||
if not focus_list.size() == 0: focus_list.front().has_focus = false
|
||||
target.has_focus = true
|
||||
if target.has_focus:
|
||||
focus_list.push_front(target)
|
||||
|
|
|
|||
Loading…
Reference in New Issue