add nil check for itemstack when placing and taking seed from inventory

This commit is contained in:
TenPlus1 2019-07-28 08:38:43 +01:00
parent 4465c49a19
commit d5dab7938a
1 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,7 @@
farming = {
mod = "redo",
version = "20190625",
version = "20190728",
path = minetest.get_modpath("farming"),
select = {
type = "fixed",
@ -461,7 +461,8 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname)
minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0})
if placer and not farming.is_creative(placer:get_player_name()) then
if placer and itemstack
and not farming.is_creative(placer:get_player_name()) then
local name = itemstack:get_name()