diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-13 21:07:43 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-04-13 21:07:43 -0400 |
commit | 4adf8611131a5d86b15f017a42a0366837d14528 (patch) | |
tree | 879ba8dfc546382c3795e3d13a623b0e17f96469 /src/SMAPI/Framework/Serialization/KeybindConverter.cs | |
parent | 5b24fff4771dd11c627ae20c827599fe37fa89ad (diff) | |
download | SMAPI-4adf8611131a5d86b15f017a42a0366837d14528.tar.gz SMAPI-4adf8611131a5d86b15f017a42a0366837d14528.tar.bz2 SMAPI-4adf8611131a5d86b15f017a42a0366837d14528.zip |
enable nullable annotations in the rest of SMAPI core (#837)
Diffstat (limited to 'src/SMAPI/Framework/Serialization/KeybindConverter.cs')
-rw-r--r-- | src/SMAPI/Framework/Serialization/KeybindConverter.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/Serialization/KeybindConverter.cs b/src/SMAPI/Framework/Serialization/KeybindConverter.cs index f3bab20d..539f1291 100644 --- a/src/SMAPI/Framework/Serialization/KeybindConverter.cs +++ b/src/SMAPI/Framework/Serialization/KeybindConverter.cs @@ -53,13 +53,13 @@ namespace StardewModdingAPI.Framework.Serialization if (objectType == typeof(Keybind)) { - return Keybind.TryParse(str, out Keybind parsed, out string[] errors) + return Keybind.TryParse(str, out Keybind? parsed, out string[] errors) ? parsed : throw new SParseException($"Can't parse {nameof(Keybind)} from invalid value '{str}' (path: {path}).\n{string.Join("\n", errors)}"); } else { - return KeybindList.TryParse(str, out KeybindList parsed, out string[] errors) + return KeybindList.TryParse(str, out KeybindList? parsed, out string[] errors) ? parsed : throw new SParseException($"Can't parse {nameof(KeybindList)} from invalid value '{str}' (path: {path}).\n{string.Join("\n", errors)}"); } |