mirror of
https://github.com/minetest/minetest_game.git
synced 2024-11-10 01:33:52 +01:00
Default: Prevent possible nil-crash on invalid book metadata
This commit is contained in:
parent
32f7051eb8
commit
1799754a8f
@ -105,7 +105,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
|
|
||||||
elseif fields.book_next or fields.book_prev then
|
elseif fields.book_next or fields.book_prev then
|
||||||
local data = minetest.deserialize(stack:get_metadata())
|
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
|
if fields.book_next then
|
||||||
data.page = data.page + 1
|
data.page = data.page + 1
|
||||||
|
Loading…
Reference in New Issue
Block a user