From 73d16ae76a81c2a080eb310b067e2533a2755770 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Tue, 4 May 2021 20:13:12 +0200 Subject: [PATCH] do not crash in case of error --- functions.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/functions.lua b/functions.lua index ae8356f..ee4f736 100644 --- a/functions.lua +++ b/functions.lua @@ -1145,6 +1145,11 @@ local function get_fs_talkdialog(player, n_id, d_id) -- Now we have a dialog to display to the user + -- do not crash in case of error + if(not(active_dialog)) then + minetest.chat_send_player(pname, "Ups! Something went wrong. Please try again.") + return + end local allowed = calculate_displayable_options(pname, active_dialog.d_options) yl_speak_up.speak_to[pname].allowed = allowed