1
0
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:
Taloth Saldono
2020-06-08 23:21:22 +02:00
parent 0ef28e5786
commit 6b7566fed8
3 changed files with 46 additions and 9 deletions
+19 -3
View File
@@ -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)