From 8cfcbea9cb6f0a7682f8fc370daa4cf56a60ed64 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 16 Mar 2019 03:09:51 +0100 Subject: [PATCH] Fix commandblock crash if opening empty one --- mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua b/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua index 281b97b101..7cd7d6c5a5 100644 --- a/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_commandblock/init.lua @@ -145,6 +145,9 @@ local on_rightclick = function(pos, node, player, itemstack, pointed_thing) local meta = minetest.get_meta(pos) local commands = meta:get_string("commands") + if not commands then + commands = "" + end local commander = meta:get_string("commander") local commanderstr if commander == "" or commander == nil then @@ -263,7 +266,7 @@ minetest.register_node("mesecons_commandblock:commandblock_on", { minetest.register_on_player_receive_fields(function(player, formname, fields) if string.sub(formname, 1, 13) == "commandblock_" then - if not fields.submit and not fields.key_enter and not fields.doc then + if (not fields.submit and not fields.key_enter and not fields.doc) or (not fields.commands) then return end local privs = minetest.get_player_privs(player:get_player_name())