diff --git a/src/TLuaInterpreter.cpp b/src/TLuaInterpreter.cpp index fd473cf5e8b..4e4c579c419 100644 --- a/src/TLuaInterpreter.cpp +++ b/src/TLuaInterpreter.cpp @@ -4848,6 +4848,10 @@ int TLuaInterpreter::searchRoom(lua_State* L) if (!roomIdsFound.isEmpty()) { for (int i : roomIdsFound) { TRoom* pR = host.mpMap->mpRoomDB->getRoom(i); + if (!pR) { + continue; + } + QString name = pR->name; int roomID = pR->getId(); lua_pushnumber(L, roomID);