summaryrefslogtreecommitdiff
path: root/src/SMAPI.Internal.Patching/BasePatcher.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Internal.Patching/BasePatcher.cs')
-rw-r--r--src/SMAPI.Internal.Patching/BasePatcher.cs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/SMAPI.Internal.Patching/BasePatcher.cs b/src/SMAPI.Internal.Patching/BasePatcher.cs
index 6d019b52..c1936ccc 100644
--- a/src/SMAPI.Internal.Patching/BasePatcher.cs
+++ b/src/SMAPI.Internal.Patching/BasePatcher.cs
@@ -1,5 +1,3 @@
-#nullable disable
-
using System;
using System.Reflection;
using HarmonyLib;
@@ -32,7 +30,7 @@ namespace StardewModdingAPI.Internal.Patching
/// <param name="name">The method name.</param>
/// <param name="parameters">The method parameter types, or <c>null</c> if it's not overloaded.</param>
/// <param name="generics">The method generic types, or <c>null</c> if it's not generic.</param>
- protected MethodInfo RequireMethod<TTarget>(string name, Type[] parameters = null, Type[] generics = null)
+ protected MethodInfo RequireMethod<TTarget>(string name, Type[]? parameters = null, Type[]? generics = null)
{
return PatchHelper.RequireMethod<TTarget>(name, parameters, generics);
}
@@ -42,7 +40,7 @@ namespace StardewModdingAPI.Internal.Patching
/// <param name="priority">The patch priority to apply, usually specified using Harmony's <see cref="Priority"/> enum, or <c>null</c> to keep the default value.</param>
protected HarmonyMethod GetHarmonyMethod(string name, int? priority = null)
{
- var method = new HarmonyMethod(
+ HarmonyMethod method = new(
AccessTools.Method(this.GetType(), name)
?? throw new InvalidOperationException($"Can't find patcher method {PatchHelper.GetMethodString(this.GetType(), name)}.")
);