Skip to content

Commit c9ef6cd

Browse files
focus_direction.py: improve corner case handling
1 parent c7546eb commit c9ef6cd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal_filesystem/lib/mpos/ui/focus_direction.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,12 @@ def process_object(obj, depth=0):
165165

166166
# This function is missing so emulate it using focus_next():
167167
def emulate_focus_obj(focusgroup, target):
168+
if not focusgroup:
169+
print("emulate_focus_obj needs a focusgroup, returning...")
170+
return
171+
if not target:
172+
print("emulate_focus_obj needs a target, returning...")
173+
return
168174
for objnr in range(focusgroup.get_obj_count()):
169175
currently_focused = focusgroup.get_focused()
170176
#print ("emulate_focus_obj: currently focused:") ; mpos.util.print_lvgl_widget(currently_focused)

0 commit comments

Comments
 (0)