Skip to content

Commit da7e8e4

Browse files
red-001paramat
authored andcommittedJun 14, 2017
Books: Add nil value checks to the book formspec handler
1 parent 175a9f8 commit da7e8e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

Diff for: ‎mods/default/craftitems.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
8080
local inv = player:get_inventory()
8181
local stack = player:get_wielded_item()
8282

83-
if fields.save and fields.title ~= "" and fields.text ~= "" then
83+
if fields.save and fields.title and fields.text
84+
and fields.title ~= "" and fields.text ~= "" then
8485
local new_stack, data
8586
if stack:get_name() ~= "default:book_written" then
8687
local count = stack:get_count()

0 commit comments

Comments
 (0)