diff --git a/src/models/actions/create/CreateSelfServiceRunner.ts b/src/models/actions/create/CreateSelfServiceRunner.ts index 2c3bc04..953db43 100644 --- a/src/models/actions/create/CreateSelfServiceRunner.ts +++ b/src/models/actions/create/CreateSelfServiceRunner.ts @@ -48,7 +48,8 @@ export class CreateSelfServiceRunner extends CreateParticipant { return group; } const team = await getConnection().getRepository(RunnerTeam).findOne({ id: this.team }, { relations: ["parentGroup"] }); - if (team.parentGroup.id != group.id || !team) { throw new RunnerTeamNotFoundError(); } + if (!team) { throw new RunnerTeamNotFoundError(); } + if (team.parentGroup.id != group.id) { throw new RunnerTeamNotFoundError(); } return team; } } \ No newline at end of file