Skip to content

Commit ca57a5a

Browse files
fix esp32 run if there's no focus group
1 parent b728aa7 commit ca57a5a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

internal_filesystem/lib/mpos/apps.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,9 @@ def _launch_activity(intent, result_callback=None):
346346
activity._result_callback = result_callback # Pass callback to activity
347347
start_time = utime.ticks_ms()
348348
# Remove objects from previous screens from the focus group:
349-
lv.group_get_default().remove_all_objs() # might be better to save and restore the group for "back" actions
349+
group = lv.group_get_default()
350+
if group: # on esp32 this may not be set
351+
group.remove_all_objs() # might be better to save and restore the group for "back" actions
350352
activity.onCreate()
351353
end_time = utime.ticks_diff(utime.ticks_ms(), start_time)
352354
print(f"apps.py _launch_activity: activity.onCreate took {end_time}ms")

internal_filesystem/lib/mpos/clipboard.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ def get():
1111
def paste_text(text): # called when CTRL-V is pressed on the keyboard
1212
print(f"mpos.ui.clipboard.py paste_text adding {text}")
1313
group = lv.group_get_default()
14+
if not group:
15+
return
1416
focused_obj = group.get_focused()
1517
if focused_obj and isinstance(focused_obj, lv.textarea):
1618
focused_obj.add_text(text)

0 commit comments

Comments
 (0)