Added nullguard to getMiniProfile()
when profile has been edited and is now corrupt
This commit is contained in:
parent
5d0cfd7971
commit
d15150f138
@ -75,6 +75,11 @@ export class ProfileController
|
|||||||
public getMiniProfile(sessionID: string): IMiniProfile
|
public getMiniProfile(sessionID: string): IMiniProfile
|
||||||
{
|
{
|
||||||
const profile = this.saveServer.getProfile(sessionID);
|
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 pmc = profile.characters.pmc;
|
||||||
const maxlvl = this.profileHelper.getMaxLevel();
|
const maxlvl = this.profileHelper.getMaxLevel();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user