diff --git a/ImperatorToCK3/CK3/Religions/Faith.cs b/ImperatorToCK3/CK3/Religions/Faith.cs index 7845513dd..62cbaa3fb 100644 --- a/ImperatorToCK3/CK3/Religions/Faith.cs +++ b/ImperatorToCK3/CK3/Religions/Faith.cs @@ -93,7 +93,11 @@ public string Serialize(string indent, bool withBraces) { } public OrderedSet GetDoctrineIdsForDoctrineCategoryId(string doctrineCategoryId) { - var category = Religion.ReligionCollection.DoctrineCategories[doctrineCategoryId]; + if (!Religion.ReligionCollection.DoctrineCategories.TryGetValue(doctrineCategoryId, out var category)) { + Logger.Warn($"Doctrine category {doctrineCategoryId} not found."); + return []; + } + return GetDoctrineIdsForDoctrineCategory(category); }