Fix this null warning in `GuiLuaLibrary`
This commit is contained in:
parent
7259a6413e
commit
45f64f62de
|
@ -1,6 +1,7 @@
|
|||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
|
@ -13,6 +14,7 @@ namespace BizHawk.Client.Common
|
|||
/// <remarks>should probably centralise these enum extensions and not-extensions somewhere... --yoshi</remarks>
|
||||
public static class DisplaySurfaceIDParser
|
||||
{
|
||||
[return: NotNullIfNotNull("str")]
|
||||
public static DisplaySurfaceID? Parse(string? str) => str?.ToLowerInvariant() switch
|
||||
{
|
||||
null => null, // this makes it easy to cascade the "remembered" value
|
||||
|
|
|
@ -193,7 +193,7 @@ namespace BizHawk.Client.Common
|
|||
Log("Surface name cannot be nil. Pass \"emucore\" to `gui.use_surface` to restore the default.");
|
||||
return;
|
||||
}
|
||||
_rememberedSurfaceID = DisplaySurfaceIDParser.Parse(surfaceName).Value; // iff param is not null, returns not null or throws
|
||||
_rememberedSurfaceID = DisplaySurfaceIDParser.Parse(surfaceName).Value;
|
||||
}
|
||||
|
||||
public void Dispose() => APIs.Gui.Dispose();
|
||||
|
|
Loading…
Reference in New Issue