Fix crash when the node.name does not contain ':'

This commit is contained in:
bri cassa 2021-08-06 21:36:24 +02:00
parent 46d347c00a
commit 968456defa

View File

@ -50,7 +50,7 @@ stairsplus.rotate_node_aux = function(itemstack, placer, pointed_thing)
local under_node = minetest.get_node(under)
local under_prefix = under_node and name_to_category(under_node.name)
-- NALC Addition to avoid coloredwood/unifiedbricks crash by Sys4
local under_pmod = string.sub(under_node.name, 1, string.find(under_node.name, ":")-1)
local under_pmod = string.sub(under_node.name, 1, (string.find(under_node.name, ":") or 0)-1)
local same_cat = item_prefix == under_prefix