diff --git a/src/lua_baselib.c b/src/lua_baselib.c
index 8409a8377da19c554f5ab977fbec60fba8decc09..1f8baedc23dfb706351bc2e30672a8198084b39d 100644
--- a/src/lua_baselib.c
+++ b/src/lua_baselib.c
@@ -2204,6 +2204,8 @@ static int lib_pTouchSpecialThing(lua_State *L)
 	INLEVEL
 	if (!special || !toucher)
 		return LUA_ErrInvalid(L, "mobj_t");
+	if (!toucher->player)
+		return luaL_error(L, "P_TouchSpecialThing requires a valid toucher.player.");
 	P_TouchSpecialThing(special, toucher, heightcheck);
 	return 0;
 }