From db057f02cf81179cfca7987ba2875a42ec7cc269 Mon Sep 17 00:00:00 2001 From: flux <25628292+fluxionary@users.noreply.github.com> Date: Mon, 10 Oct 2022 14:48:33 -0700 Subject: [PATCH] don't crash if there's no owner --- api/register_machine.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/api/register_machine.lua b/api/register_machine.lua index 302a9c1..f83f262 100644 --- a/api/register_machine.lua +++ b/api/register_machine.lua @@ -45,17 +45,14 @@ function api.update(pos, node) if get_info then local info = get_info(pos) if public == 0 then - local owner = meta:get("owner") - meta:set_string("infotext", S("@1 (owned by @2)", info, owner)) + local owner = meta:get("owner") or "???" + meta:set_string("infotext", S("@1's private @2", owner, info)) elseif public == 1 then meta:set_string("infotext", S("protected @1", info)) elseif public == 2 then meta:set_string("infotext", S("public @1", info)) - - else - meta:set_string("infotext", "ERROR IN INFOTEXT") end else