fix: handle case where PartyMember.Actor is null

I don't know how this is possible, but someone had this happen, so I
guess just coalesce the null. If the targeter is in the party, this
will result in incorrect behaviour and log them, but it's better than
a crash.
This commit is contained in:
Anna 2020-07-30 22:12:37 -04:00
parent 0d1f40823e
commit 141a2fad25
1 changed files with 1 additions and 1 deletions

View File

@ -500,7 +500,7 @@ namespace PeepingTom {
return this.pi.ClientState.Actors
.Where(actor => actor.TargetActorID == player.ActorId && actor is PlayerCharacter)
.Select(actor => actor as PlayerCharacter)
.Where(actor => this.config.LogParty || this.pi.ClientState.PartyList.All(member => member.Actor.ActorId != actor.ActorId))
.Where(actor => this.config.LogParty || this.pi.ClientState.PartyList.All(member => member.Actor?.ActorId != actor.ActorId))
.Where(actor => this.config.LogAlliance || !this.InAlliance(actor))
.Where(actor => this.config.LogInCombat || !this.InCombat(actor))
.ToArray();