summaryrefslogtreecommitdiff
path: root/src/SMAPI.Mods.ErrorHandler/Patches/GameLocationPatcher.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-13 22:06:07 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-13 22:06:07 -0400
commit2765e3f9b379f0dc2a5732c1ca9ba23dbe2a7f15 (patch)
tree3b97dd4aa6e9b7971dafa139c64a39c31e841fe6 /src/SMAPI.Mods.ErrorHandler/Patches/GameLocationPatcher.cs
parentaa7b0caf4656d65ee156c3cf5ea786f561b850bb (diff)
downloadSMAPI-2765e3f9b379f0dc2a5732c1ca9ba23dbe2a7f15.tar.gz
SMAPI-2765e3f9b379f0dc2a5732c1ca9ba23dbe2a7f15.tar.bz2
SMAPI-2765e3f9b379f0dc2a5732c1ca9ba23dbe2a7f15.zip
enable nullable annotations in bundled mods (#837)
Diffstat (limited to 'src/SMAPI.Mods.ErrorHandler/Patches/GameLocationPatcher.cs')
-rw-r--r--src/SMAPI.Mods.ErrorHandler/Patches/GameLocationPatcher.cs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/SMAPI.Mods.ErrorHandler/Patches/GameLocationPatcher.cs b/src/SMAPI.Mods.ErrorHandler/Patches/GameLocationPatcher.cs
index 98aa4a38..9247fa48 100644
--- a/src/SMAPI.Mods.ErrorHandler/Patches/GameLocationPatcher.cs
+++ b/src/SMAPI.Mods.ErrorHandler/Patches/GameLocationPatcher.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
using System;
using System.Diagnostics.CodeAnalysis;
using HarmonyLib;
@@ -19,8 +17,7 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches
** Fields
*********/
/// <summary>Writes messages to the console and log file on behalf of the game.</summary>
- private static IMonitor MonitorForGame;
-
+ private static IMonitor MonitorForGame = null!;
/*********
** Public methods
@@ -54,7 +51,7 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches
/// <param name="precondition">The precondition to be parsed.</param>
/// <param name="__exception">The exception thrown by the wrapped method, if any.</param>
/// <returns>Returns the exception to throw, if any.</returns>
- private static Exception Finalize_CheckEventPrecondition(ref int __result, string precondition, Exception __exception)
+ private static Exception? Finalize_CheckEventPrecondition(ref int __result, string precondition, Exception? __exception)
{
if (__exception != null)
{
@@ -70,7 +67,7 @@ namespace StardewModdingAPI.Mods.ErrorHandler.Patches
/// <param name="map">The map whose tilesheets to update.</param>
/// <param name="__exception">The exception thrown by the wrapped method, if any.</param>
/// <returns>Returns the exception to throw, if any.</returns>
- private static Exception Finalize_UpdateSeasonalTileSheets(GameLocation __instance, Map map, Exception __exception)
+ private static Exception? Finalize_UpdateSeasonalTileSheets(GameLocation __instance, Map map, Exception? __exception)
{
if (__exception != null)
GameLocationPatcher.MonitorForGame.Log($"Failed updating seasonal tilesheets for location '{__instance.NameOrUniqueName}': \n{__exception}", LogLevel.Error);