Skip to content

Commit

Permalink
Prevent missing religious head character from causing an exception (#…
Browse files Browse the repository at this point in the history
…1868) #patch

Sentry event ID: ee005e56b7434ce4925e015ef458982c
  • Loading branch information
IhateTrains authored Apr 10, 2024
1 parent 35e7df1 commit 6f18ded
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ImperatorToCK3/CK3/Religions/ReligionCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,11 @@ Date date
}
var holderId = title.GetHolderId(date);
if (holderId != "0") {
var holder = characters[holderId];
if (!characters.TryGetValue(holderId, out var holder)) {
Logger.Warn($"Religious head {holderId} of title {title.Id} for {faith.Id} not found!");
return;
}

var holderDeathDate = holder.DeathDate;
if (holderDeathDate is null || holderDeathDate > date) {
return;
Expand Down

0 comments on commit 6f18ded

Please sign in to comment.