Safely exit returnPlayerOffer()
when no profile is found
(cherry picked from commit af6d138f3cfcfca742f8b38e5f66780c4c0970f2)
This commit is contained in:
parent
3f7f357bff
commit
665778eaf1
@ -256,6 +256,12 @@ export class RagfairOfferService
|
|||||||
{
|
{
|
||||||
const pmcId = String(playerOffer.user.id);
|
const pmcId = String(playerOffer.user.id);
|
||||||
const profile = this.profileHelper.getProfileByPmcId(pmcId);
|
const profile = this.profileHelper.getProfileByPmcId(pmcId);
|
||||||
|
if (!profile)
|
||||||
|
{
|
||||||
|
this.logger.error(`Unable to return flea offer ${playerOffer._id} as the profile: ${pmcId} could not be found`);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const offerinProfileIndex = profile.RagfairInfo.offers.findIndex((o) => o._id === playerOffer._id);
|
const offerinProfileIndex = profile.RagfairInfo.offers.findIndex((o) => o._id === playerOffer._id);
|
||||||
if (offerinProfileIndex === -1)
|
if (offerinProfileIndex === -1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user