Skip to content

Commit

Permalink
Maybe blackscreen fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cybershard committed Sep 19, 2021
1 parent 85ec849 commit 1e979be
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Reflection;
using Avalonia.Rendering;
using HarmonyLib;
Expand All @@ -23,4 +24,18 @@ public static bool Prefix(DeferredRenderer __instance)
return _trueRenderMethod is null;
}
}

[HarmonyPatch]
public static class DeferredRenderer_Render_Patch
{
public static MethodBase TargetMethod() => AccessTools.Method(
AccessTools.TypeByName(nameof(Avalonia.Rendering.DeferredRenderer)), "Render", new[] { typeof(bool) });
public static Exception Finalizer(Exception __exception)
{
if (__exception.Message.Contains("Invalid create info - no Canvas provided"))
return null;

return __exception;
}
}
}

0 comments on commit 1e979be

Please sign in to comment.