]> git.lizzy.rs Git - signs_lib.git/commitdiff
add nil check
authortenplus1 <tenplus1@users.noreply.github.com>
Wed, 19 Jul 2017 18:46:54 +0000 (19:46 +0100)
committerGitHub <noreply@github.com>
Wed, 19 Jul 2017 18:46:54 +0000 (19:46 +0100)
add nil check to fix this error: https://github.com/minetest-mods/signs_lib/issues/18

init.lua

index 775db95fff6247c64dbe2581ea60d09501e800da..270af714f538d99b932d666d64b08245a54bb2bd 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -413,7 +413,7 @@ end
 local function set_obj_text(obj, text, new, pos)
        local split = new and split_lines_and_words or split_lines_and_words_old
        local n = minetest.registered_nodes[minetest.get_node(pos).name]
-       local text_scale = n.text_scale or DEFAULT_TEXT_SCALE
+       local text_scale = (n and n.text_scale) or DEFAULT_TEXT_SCALE
        obj:set_properties({
                textures={make_sign_texture(split(text), pos)},
                visual_size = text_scale,