Skip to content

Commit

Permalink
Prevent KeyNotFoundException when setting governorship title localiza…
Browse files Browse the repository at this point in the history
…tion (#329) #patch
  • Loading branch information
IhateTrains authored Sep 27, 2021
1 parent b23ed2f commit 6a642c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ImperatorToCK3/CK3/Titles/Title.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Mappers.Region.ImperatorRegionMapper imperatorRegionMapper
// ------------------ Country Name Locs
var nameSet = false;
LocBlock? regionLocBlock = localizationMapper.GetLocBlockForKey(governorship.RegionName);
var countryAdjectiveLocBlock = country.CK3Title.Localizations[country.CK3Title.Name + "_adj"];
country.CK3Title.Localizations.TryGetValue(country.CK3Title.Name + "_adj", out var countryAdjectiveLocBlock);
if (regionLocBlock is not null && countryAdjectiveLocBlock is not null) {
var nameLocBlock = new LocBlock(regionLocBlock);
nameLocBlock.ModifyForEveryLanguage(countryAdjectiveLocBlock,
Expand Down

0 comments on commit 6a642c3

Please sign in to comment.