From 20b1594e179d33830af2330c5709377c28304b8c Mon Sep 17 00:00:00 2001 From: Kevin Zander Date: Wed, 20 Jun 2018 17:24:45 -0500 Subject: [PATCH] Return nil for screen string index lookup instead of throwing error --- objects/screen.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/objects/screen.c b/objects/screen.c index 34e0f96ef..200da4bb9 100644 --- a/objects/screen.c +++ b/objects/screen.c @@ -1040,7 +1040,9 @@ luaA_screen_module_index(lua_State *L) foreach(output, (*screen)->outputs) if(A_STREQ(output->name, name)) return luaA_object_push(L, *screen); - luaL_error(L, "Unknown screen output name: %s", name); + luaA_warn(L, "Unknown screen output name: %s", name); + lua_pushnil(L); + return 1; } return luaA_object_push(L, luaA_checkscreen(L, 2));