Skip to content

Commit 6a642c3

Browse files
authored
Prevent KeyNotFoundException when setting governorship title localization (#329) #patch
1 parent b23ed2f commit 6a642c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ImperatorToCK3/CK3/Titles/Title.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ Mappers.Region.ImperatorRegionMapper imperatorRegionMapper
220220
// ------------------ Country Name Locs
221221
var nameSet = false;
222222
LocBlock? regionLocBlock = localizationMapper.GetLocBlockForKey(governorship.RegionName);
223-
var countryAdjectiveLocBlock = country.CK3Title.Localizations[country.CK3Title.Name + "_adj"];
223+
country.CK3Title.Localizations.TryGetValue(country.CK3Title.Name + "_adj", out var countryAdjectiveLocBlock);
224224
if (regionLocBlock is not null && countryAdjectiveLocBlock is not null) {
225225
var nameLocBlock = new LocBlock(regionLocBlock);
226226
nameLocBlock.ModifyForEveryLanguage(countryAdjectiveLocBlock,

0 commit comments

Comments
 (0)