Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Books: Add nil value checks to the book formspec handler
  • Loading branch information
red-001 authored and paramat committed Jun 14, 2017
1 parent 175a9f8 commit da7e8e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mods/default/craftitems.lua
Expand Up @@ -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()
Expand Down

0 comments on commit da7e8e4

Please sign in to comment.