From 319f05edc5d8f43a2acd53bd1ea592fd39616f78 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Tue, 4 May 2021 00:36:15 +0200 Subject: [PATCH] #8 and #10 fixed bug with d_options beeing nil --- functions.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/functions.lua b/functions.lua index 8ad2629..a329615 100644 --- a/functions.lua +++ b/functions.lua @@ -2340,6 +2340,11 @@ minetest.register_on_player_receive_fields( local n_dialog = dialog.n_dialogs[d_id] + -- if there are no options, there can be no results either + if(not(n_dialog) or not(n_dialog.d_options)) then + return + end + local d_option = n_dialog.d_options[o] -- Let's do something if results exist