diff --git a/project/src/controllers/ProfileController.ts b/project/src/controllers/ProfileController.ts index 587867c1..b21c470b 100644 --- a/project/src/controllers/ProfileController.ts +++ b/project/src/controllers/ProfileController.ts @@ -75,6 +75,11 @@ export class ProfileController public getMiniProfile(sessionID: string): IMiniProfile { const profile = this.saveServer.getProfile(sessionID); + if (!profile || !profile.characters) + { + throw new Error(`Unable to find character data for id: ${sessionID}. Profile may be corrupt`); + } + const pmc = profile.characters.pmc; const maxlvl = this.profileHelper.getMaxLevel();