From 09974f0c9070b6bbe474cb22444368d7d1d453fb Mon Sep 17 00:00:00 2001 From: coil <51716565+coil0@users.noreply.github.com> Date: Mon, 23 Dec 2019 22:04:02 -0500 Subject: [PATCH] Add nil check for node def --- display.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/display.lua b/display.lua index 2fed40f..6994e4e 100644 --- a/display.lua +++ b/display.lua @@ -162,6 +162,9 @@ function display_api.update_entities(pos) local node = minetest.get_node(pos) local ndef = minetest.registered_nodes[node.name] local ov = get_orientation_values(node) + if not ndef or not ov then + return + end for _, objref in pairs(get_display_objrefs(pos, true)) do local edef = ndef.display_entities[objref:get_luaentity().name] @@ -283,6 +286,9 @@ end function display_api.on_rotate(pos, node, user, _, new_param2) node.param2 = new_param2 local ov = get_orientation_values(node) + if not ov then + return + end if ov.restricted or not display_api.is_rotation_restricted() then minetest.swap_node(pos, node)