player:get_properties()
may return nothing inside on_joinplayer
#12350
Labels
player:get_properties()
may return nothing inside on_joinplayer
#12350
Minetest version
Summary
See this bug report. The line in question contains just
local mesh = player:get_properties().mesh
and sometimes triggers an "attempt to index anil
value" error when called from inside on joinplayer.Steps to reproduce
this seems to be a Heisenbug so you may have to try various connection scenarios which may invalidate the player (properties)
Possible fixes
get_properties()
returns nothing (currently the docs claim it returns an object property table, which is not always the case), which seems to be the case (1) if the objref is invalid (player left?) or (2) ifm_prop
isnull
(how is this even possible?)The text was updated successfully, but these errors were encountered: