diff --git a/src/events/gameMaster/mapEditor/request.ts b/src/events/gameMaster/mapEditor/request.ts index c742d4c..28e350a 100644 --- a/src/events/gameMaster/mapEditor/request.ts +++ b/src/events/gameMaster/mapEditor/request.ts @@ -25,13 +25,14 @@ export default class MapRequestEvent extends BaseEvent { const mapRepository = new MapRepository() const map = await mapRepository.getById(data.mapId) - await mapRepository.getEntityManager().populate(map!, mapRepository.POPULATE_MAP_EDITOR as any) if (!map) { this.logger.info(`User ${(await this.getCharacter())!.getId()} tried to request map ${data.mapId} but it does not exist.`) return callback(null) } + await mapRepository.getEntityManager().populate(map, mapRepository.POPULATE_MAP_EDITOR as any) + return callback(map) } catch (error: any) { this.logger.error('gm:map:request error', error.message)