From 35daf8710f05c8ba0238df4675ae8f2219dfc79e Mon Sep 17 00:00:00 2001 From: Dev Date: Sun, 14 Jul 2024 17:21:12 +0100 Subject: [PATCH] Added null protected around `RagfairInfo` on profile login --- project/src/controllers/GameController.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/project/src/controllers/GameController.ts b/project/src/controllers/GameController.ts index aae2ce94..6ff1f818 100644 --- a/project/src/controllers/GameController.ts +++ b/project/src/controllers/GameController.ts @@ -152,6 +152,15 @@ export class GameController return; } + if (fullProfile.characters.pmc.RagfairInfo) + { + if (Number.isNaN(fullProfile.characters.pmc.RagfairInfo.rating)) + { + this.logger.warning(`Profile: ${sessionID} ragfair rating was not a valid number, resetting to 0`); + fullProfile.characters.pmc.RagfairInfo.rating = 0; + } + } + if (Array.isArray(fullProfile.characters.pmc.WishList)) { fullProfile.characters.pmc.WishList = {};