From: red-001 Date: Tue, 13 Jun 2017 22:59:25 +0000 (+0100) Subject: Books: Add nil value checks to the book formspec handler X-Git-Tag: 0.4.17.1~41 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=706844e8bf5df818bdbd2409acae3c722d704752;p=oweals%2Fminetest_game.git Books: Add nil value checks to the book formspec handler --- diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua index 33cdd5f6..1500a346 100644 --- a/mods/default/craftitems.lua +++ b/mods/default/craftitems.lua @@ -80,7 +80,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) local inv = player:get_inventory() local stack = player:get_wielded_item() - if fields.save and fields.title ~= "" and fields.text ~= "" then + if fields.save and fields.title and fields.text + and fields.title ~= "" and fields.text ~= "" then local new_stack, data if stack:get_name() ~= "default:book_written" then local count = stack:get_count()