diff options
author | Wuzzy <almikes@aol.com> | 2016-08-12 21:54:15 +0200 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-08-12 21:54:15 +0200 |
commit | 5127c79c2069e3fe9d3ea4c327c67fb5bfe51c2f (patch) | |
tree | 80888811c7e9ae7cee1b07ee45a328639d2d4c24 /init.lua | |
parent | ebda8931ab57b0467d1b155c5f470454d8d2dd6d (diff) |
Prevent next/prev crash when catsel==nil
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -430,6 +430,7 @@ function doc.process_form(player,formname,fields) local formspec = doc.formspec_core(2)..doc.formspec_category(doc.data.players[playername].category, playername) minetest.show_formspec(playername, "doc:category", formspec) elseif fields["doc_button_goto_next"] then + if doc.data.players[playername].catsel == nil then return end -- emergency exit local eids = doc.data.players[playername].entry_ids local cid = doc.data.players[playername].category local new_catsel= doc.data.players[playername].catsel + 1 @@ -442,6 +443,7 @@ function doc.process_form(player,formname,fields) doc.data.players[playername].entry = new_eid end elseif fields["doc_button_goto_prev"] then + if doc.data.players[playername].catsel == nil then return end -- emergency exit local eids = doc.data.players[playername].entry_ids local cid = doc.data.players[playername].category local new_catsel= doc.data.players[playername].catsel - 1 |