Skip to content

Commit

Permalink
Fix getting wrong error message
Browse files Browse the repository at this point in the history
  • Loading branch information
JensForstmann committed Oct 9, 2023
1 parent de25364 commit 4de4304
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/src/match.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ export const createFromCreateDto = async (dto: IMatchCreateDto, id: string, logS
await init(match);
return match;
} catch (err) {
await ManagedGameServers.free(gameServer, id);
await ManagedGameServers.update({ ...gameServer, canBeUsed: false });
if (!dto.gameServer) {
await ManagedGameServers.free(gameServer, id);
await ManagedGameServers.update({ ...gameServer, canBeUsed: false });
}
throw err;
}
};
Expand Down

0 comments on commit 4de4304

Please sign in to comment.