From 1799754a8fc4757386eee40358228bc639ea8ce2 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 4 Oct 2016 19:49:06 +0200 Subject: [PATCH] Default: Prevent possible nil-crash on invalid book metadata --- mods/default/craftitems.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua index d821af06..59539f37 100644 --- a/mods/default/craftitems.lua +++ b/mods/default/craftitems.lua @@ -105,7 +105,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) elseif fields.book_next or fields.book_prev then local data = minetest.deserialize(stack:get_metadata()) - if not data.page then return end + if not data or not data.page then + return + end if fields.book_next then data.page = data.page + 1