Skip to content

Commit

Permalink
Null fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Apr 7, 2024
1 parent ee1d4d3 commit 5525438
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/BUTR.CrashReport.Bannerlord.Source/HarmonyProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class HarmonyProvider : IHarmonyProvider
{
public virtual IEnumerable<MethodBase> GetAllPatchedMethods() => Harmony.GetAllPatchedMethods();

public virtual global::BUTR.CrashReport.Models.HarmonyPatches GetPatchInfo(MethodBase originalMethod)
public virtual global::BUTR.CrashReport.Models.HarmonyPatches? GetPatchInfo(MethodBase originalMethod)
{
static global::BUTR.CrashReport.Models.HarmonyPatch Convert(Patch patch, global::BUTR.CrashReport.Models.HarmonyPatchType type) => new()
{
Expand All @@ -83,6 +83,7 @@ public class HarmonyProvider : IHarmonyProvider
};

var patches = Harmony.GetPatchInfo(originalMethod);
if (patches is null) return null;
return new()
{
Prefixes = patches.Prefixes.Select(x => Convert(x, Models.HarmonyPatchType.Prefix)).ToArray(),
Expand Down

0 comments on commit 5525438

Please sign in to comment.