diff options
Diffstat (limited to 'src/ui/ui_fsm.cpp')
| -rw-r--r-- | src/ui/ui_fsm.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ui/ui_fsm.cpp b/src/ui/ui_fsm.cpp index ed0624df..5b4ea2a7 100644 --- a/src/ui/ui_fsm.cpp +++ b/src/ui/ui_fsm.cpp @@ -238,8 +238,7 @@ auto Lua::PushLuaScreen(lua_State* s) -> int { // Call the constructor for this screen. lua_settop(s, 1); // Make sure the function is actually at top of stack - // FIXME: This should ideally be lua_pcall, for safety. - lua_call(s, 0, 1); + lua::CallProtected(s, 0, 1); // Store the reference for the table the constructor returned. new_screen->SetObjRef(s); @@ -262,6 +261,10 @@ void Lua::exit() { lv_group_set_default(NULL); } +void Lua::react(const OnLuaError& err) { + ESP_LOGE("lua", "%s", err.message.c_str()); +} + void Lua::react(const internal::IndexSelected& ev) { auto db = sServices->database().lock(); if (!db) { |
