Skip to content

Commit

Permalink
fix(messages/emitMessage): use method with caught exception when fetc…
Browse files Browse the repository at this point in the history
…hing sender player
  • Loading branch information
LiamDormon committed Apr 25, 2022
1 parent 85f3667 commit 35b6d90
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions resources/server/messages/messages.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,10 @@ class _MessagesService {
const { senderNumber, targetNumber, message } = dto;

try {
const senderPlayer = await PlayerService.getIdentifierByPhoneNumber(senderNumber, true);
// this will post an error message if the number doesn't exist but emitMessage will so go through from roleplay number
const senderPlayer = await PlayerService.getIdentifierFromPhoneNumber(senderNumber, true);

const participantIdentifier = await PlayerService.getIdentifierByPhoneNumber(targetNumber);
const participantIdentifier = await PlayerService.getIdentifierFromPhoneNumber(targetNumber);
const participantPlayer = PlayerService.getPlayerFromIdentifier(participantIdentifier);

// Create our groupId hash
Expand Down

0 comments on commit 35b6d90

Please sign in to comment.