From ab559a6f36a8683167be00020373e595ab748a33 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 2 Jul 2017 13:28:03 +0200 Subject: [PATCH] Provide better error message for unknown screen names The screen object can be indexed by strings to find a screen via some RANDR output name. However, if a string is used which does not correspond to a known output, the code just falls through to a function which will complain "string provided, userdata expected". This commit provides a slightly more useful error message instead. Signed-off-by: Uli Schlachter --- objects/screen.c | 1 + 1 file changed, 1 insertion(+) diff --git a/objects/screen.c b/objects/screen.c index 9ed3db962..5b701f29c 100644 --- a/objects/screen.c +++ b/objects/screen.c @@ -1029,6 +1029,7 @@ 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); } return luaA_object_push(L, luaA_checkscreen(L, 2));