Code order improvement
This commit is contained in:
parent
a5d8cf5ef9
commit
53c232d0a3
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user