diff --git a/src/faction/faction.service.ts b/src/faction/faction.service.ts index 06940338dabf99494ed657a0cd56cefb9576ccf5..ab1dd014165b8c8c37b812b70757f3792fa59711 100644 --- a/src/faction/faction.service.ts +++ b/src/faction/faction.service.ts @@ -134,12 +134,16 @@ export class FactionService { where: { person, game }, relations: ['faction'], }); - if (gameperson) { + if (gameperson.faction) { return { factionId: gameperson.faction.factionId, + factionName: gameperson.faction.factionName, }; } else { - throw new HttpException('No faction was found', HttpStatus.BAD_REQUEST); + throw new HttpException( + gameperson ? 'You are admin for this game!' : 'No faction was found', + HttpStatus.BAD_REQUEST, + ); } } }