Skip to content

Commit

Permalink
Fix crash on some missing highlight mods (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco committed Sep 21, 2021
1 parent 55750b5 commit efdc269
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Core_Sideloader/UniversalAutoResolver/Core.UAR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ internal static void ResolveStructure(Dictionary<CategoryProperty, StructValue<i
#endif
{
#if KK || EC || KKS
string mainAB = Lists.InternalDataList[kv.Key.Category][kv.Value.GetMethod(structure)].dictInfo[(int)ChaListDefine.KeyType.MainAB];
Lists.InternalDataList[kv.Key.Category][kv.Value.GetMethod(structure)].dictInfo.TryGetValue((int)ChaListDefine.KeyType.MainAB, out string mainAB);
#elif AI || HS2
string mainAB = Lists.InternalDataList[(int)kv.Key.Category][kv.Value.GetMethod(structure)].dictInfo[(int)ChaListDefine.KeyType.MainAB];
Lists.InternalDataList[(int)kv.Key.Category][kv.Value.GetMethod(structure)].dictInfo.TryGetValue((int)ChaListDefine.KeyType.MainAB, out string mainAB);
#endif
mainAB = mainAB.Replace("chara/", "").Replace(".unity3d", "").Replace(kv.Key.Category.ToString() + "_", "").Replace("/", "");
mainAB = mainAB?.Replace("chara/", "").Replace(".unity3d", "").Replace(kv.Key.Category.ToString() + "_", "").Replace("/", "");

if (int.TryParse(mainAB, out int x))
{
Expand Down

0 comments on commit efdc269

Please sign in to comment.