Clean up nullability

This commit is contained in:
Matt Nadareski
2025-10-16 21:09:42 -04:00
parent 2325844bd4
commit b2fcc190fd
2 changed files with 11 additions and 4 deletions

View File

@@ -213,6 +213,14 @@ namespace MPF.Frontend
#region Convert to Short Name
/// <summary>
/// Get the short string representation of the InterfaceLanguage enum values
/// </summary>
/// <param name="lang">InterfaceLanguage value to convert</param>
/// <returns>String representing the value, if possible</returns>
public static string ShortName(this InterfaceLanguage lang)
=> ((InterfaceLanguage?)lang).ShortName();
/// <summary>
/// Get the short string representation of the InterfaceLanguage enum values
/// </summary>

View File

@@ -145,13 +145,12 @@ namespace MPF.Frontend
/// <summary>
/// Default UI language to launch MPF into
/// </summary>
public InterfaceLanguage? DefaultUILanguage
public InterfaceLanguage DefaultUILanguage
{
get
{
var valueString = GetStringSetting(Settings, "DefaultUILanguage", RedumpSystem.IBMPCcompatible.LongName());
var valueEnum = (valueString ?? string.Empty).ToInterfaceLanguage();
return valueEnum;
var valueString = GetStringSetting(Settings, "DefaultUILanguage", InterfaceLanguage.AutoDetect.ShortName());
return valueString.ToInterfaceLanguage();
}
set
{