diff --git a/src/lua_mobjlib.c b/src/lua_mobjlib.c
index ebe995ea8cf17a9ed52341a7c2feb18d3a04a9a2..6bdebf774df50d0527e3f5713043e008f5c3e33e 100644
--- a/src/lua_mobjlib.c
+++ b/src/lua_mobjlib.c
@@ -198,12 +198,12 @@ static int mobj_get(lua_State *L)
 	enum mobj_e field = Lua_optoption(L, 2, -1, mobj_fields_ref);
 	lua_settop(L, 2);
 
-	if (!mo || !ISINLEVEL) {
+	if (P_MobjWasRemoved(mo) || !ISINLEVEL) {
 		if (field == mobj_valid) {
 			lua_pushboolean(L, 0);
 			return 1;
 		}
-		if (!mo) {
+		if (P_MobjWasRemoved(mo)) {
 			return LUA_ErrInvalid(L, "mobj_t");
 		} else
 			return luaL_error(L, "Do not access an mobj_t field outside a level!");