Splizard / minetest-mod-snow

Adds snow biomes to Minetest.
http://splizard.com/minetest/mods/snow-biomes/
Other
10 stars 9 forks source link

attempt to index local 'node' (a nil value) in init.lua #6

Closed heavygale closed 9 years ago

heavygale commented 10 years ago

I just got the following error:

13:29:04: ERROR[main]: ERROR: An unhandled exception occurred: /home/minetest/bin/../mods/snow/init.lua:91: attempt to index local 'node' (a nil value) 13:29:04: ERROR[main]: stack traceback: 13:29:04: ERROR[main]: /home/minetest/bin/../mods/snow/init.lua:91: in function 'place' 13:29:04: ERROR[main]: /home/minetest/bin/../mods/landrush/snow.lua:20: in function </home/minetest/bin/../mods/landrush/snow.lua:12>

This may be a bug in landrush, but the snow mod shouldn't cause a nil pointer exception which shuts down the server either. (Maybe just leave the function when minetest.get_node_or_nil(pos) returns nil.)

Splizard commented 10 years ago

Hi do you know when the bug happens, Im just curious, ill try and push a fix soon.

HybridDog commented 10 years ago

@Splizard you use minetest.get_node_or_nil(), so if the area isn't loaded, node is nil. If you would use minetest.get_node(), node.name would be "ignore", I think. You may abort the function if node == nil and maybe return true if not.

Splizard commented 9 years ago

Fixed 37ecfd02a8d7cf5e0c743e9f9782e9be0551baf8