diff --git a/project/src/controllers/InraidController.ts b/project/src/controllers/InraidController.ts index 71225ed6..b38cf227 100644 --- a/project/src/controllers/InraidController.ts +++ b/project/src/controllers/InraidController.ts @@ -96,7 +96,21 @@ export class InraidController public addPlayer(sessionID: string, info: IRegisterPlayerRequestData): void { this.applicationContext.addValue(ContextVariableType.REGISTER_PLAYER_REQUEST, info); - this.saveServer.getProfile(sessionID).inraid.location = info.locationId; + const profile = this.saveServer.getProfile(sessionID); + if (!profile) + { + this.logger.error(`No profile found with Id of: ${sessionID}`); + + return; + } + if (!profile.inraid) + { + profile.inraid = { character: sessionID, location: info.locationId }; + } + else + { + profile.inraid.location; + } } /**