From 1d9116f0a0b01d29cb8af5c9d9d44d49e794769c Mon Sep 17 00:00:00 2001 From: goat Date: Thu, 26 Dec 2024 13:29:54 +0100 Subject: [PATCH] unhandled exceptions when calling Draw() must be fatal --- Dalamud/Interface/Internal/InterfaceManager.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Dalamud/Interface/Internal/InterfaceManager.cs b/Dalamud/Interface/Internal/InterfaceManager.cs index 36f48f9b8..65f2da705 100644 --- a/Dalamud/Interface/Internal/InterfaceManager.cs +++ b/Dalamud/Interface/Internal/InterfaceManager.cs @@ -1142,7 +1142,18 @@ internal partial class InterfaceManager : IInternalDisposableService if (this.IsDispatchingEvents) { - this.Draw?.Invoke(); + try + { + this.Draw?.Invoke(); + } + catch (Exception ex) + { + Log.Error(ex, "Error when invoking global Draw"); + + // We should always handle this in the callbacks. + Util.Fatal("An internal error occurred while drawing the Dalamud UI and the game must close.\nPlease report this error.", "Dalamud"); + } + Service.GetNullable()?.Draw(); } }