diff --git a/objects/screen.c b/objects/screen.c index 5b701f29..f0943c78 100644 --- a/objects/screen.c +++ b/objects/screen.c @@ -1222,6 +1222,9 @@ luaA_screen_swap(lua_State *L) if(ref_s && ref_swap) break; } + if(!ref_s || !ref_swap) + return luaL_error(L, "Invalid call to screen:swap()"); + /* swap ! */ *ref_s = swap; *ref_swap = s;