mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-23 22:25:56 -04:00
Fixed error in opcode parameter that only shows itself in mono under 6.x
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using HarmonyLib;
|
||||
|
||||
@@ -8,6 +9,8 @@ namespace NzbDrone.RuntimePatches
|
||||
{
|
||||
private Harmony _harmony;
|
||||
|
||||
internal static bool IsDebug;
|
||||
|
||||
public virtual bool ShouldPatch() => true;
|
||||
protected abstract void Patch();
|
||||
|
||||
@@ -101,11 +104,24 @@ namespace NzbDrone.RuntimePatches
|
||||
return null;
|
||||
}
|
||||
|
||||
protected void DebugOpcodes(string prefix, List<CodeInstruction> codes)
|
||||
{
|
||||
if (IsDebug)
|
||||
{
|
||||
Log($"Opcodes {prefix}:");
|
||||
foreach (var code in codes)
|
||||
{
|
||||
Console.WriteLine($" {code}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void Debug(string log)
|
||||
{
|
||||
#if DEBUG
|
||||
Log(log);
|
||||
#endif
|
||||
if (IsDebug)
|
||||
{
|
||||
Log(log);
|
||||
}
|
||||
}
|
||||
|
||||
protected void Error(string log)
|
||||
|
||||
Reference in New Issue
Block a user