Skip to content

Commit

Permalink
fix(ApplicationLanguages): Prevent NullReferenceException for Manifes…
Browse files Browse the repository at this point in the history
…tLanguages
  • Loading branch information
Yohan Guerin committed Jun 8, 2021
1 parent adf8a27 commit 60a913f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Uno.UWP/Globalization/ApplicationLanguages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ private static string[] GetManifestLanguages()
var languages = new[]
{
#if __ANDROID__
#pragma warning disable CS0618 // Type or member is obsolete
ContextHelper.Current.Resources.Configuration.Locale.ToLanguageTag(),
#pragma warning restore CS0618 // Type or member is obsolete
ContextHelper.Current?.Resources?.Configuration?.Locales?.Get(0)?.ToLanguageTag(),
#endif
CultureInfo.InstalledUICulture.Name,
CultureInfo.CurrentUICulture.Name,
CultureInfo.CurrentCulture.Name
CultureInfo.InstalledUICulture?.Name,
CultureInfo.CurrentUICulture?.Name,
CultureInfo.CurrentCulture?.Name
};

return languages
Expand Down

0 comments on commit 60a913f

Please sign in to comment.