Skip to content

Commit

Permalink
Handle DNA generation exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
IhateTrains committed Jan 9, 2025
1 parent c962342 commit 5b44e48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ImperatorToCK3/CK3/Characters/CharacterCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,11 @@ internal void ConvertImperatorCharacterDNA(DNAFactory dnaFactory) {

PortraitData? portraitData = character.ImperatorCharacter.PortraitData;
if (portraitData is not null) {
character.DNA = dnaFactory.GenerateDNA(character.ImperatorCharacter, portraitData);
try {
character.DNA = dnaFactory.GenerateDNA(character.ImperatorCharacter, portraitData);
} catch (Exception e) {
Logger.Warn($"Failed to generate DNA for character {character.Id}: {e.Message}");
}
}
}
}
Expand Down

0 comments on commit 5b44e48

Please sign in to comment.