Skip to content

Commit

Permalink
fix: GetCulturesHierarchy loop on invalid CultureInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Feb 27, 2023
1 parent 772427d commit d3942bb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Uno.UWP/ApplicationModel/Resources/ResourceLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ private static IEnumerable<string> GetCulturesHierarchy(CultureInfo culture)
}
}

if (culture == culture.Parent)
{
// On .NET Framework 4.8, culture may equal culture.Parent even if it's
// not equal to CultureInfo.InvariantCulture when reaching the end of the
// culture chain.
break;
}

culture = culture.Parent;
}

Expand Down

0 comments on commit d3942bb

Please sign in to comment.