From d836a3e55631d6af4489740cbf18c64350064420 Mon Sep 17 00:00:00 2001 From: Haselnussbomber Date: Wed, 20 Sep 2023 19:14:22 +0200 Subject: [PATCH] Catch exceptions in Window.Draw --- Dalamud/Interface/Windowing/Window.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Dalamud/Interface/Windowing/Window.cs b/Dalamud/Interface/Windowing/Window.cs index 39c61566b..73a14db79 100644 --- a/Dalamud/Interface/Windowing/Window.cs +++ b/Dalamud/Interface/Windowing/Window.cs @@ -1,9 +1,11 @@ +using System; using System.Numerics; using Dalamud.Configuration.Internal; using Dalamud.Game.ClientState.Keys; using FFXIVClientStructs.FFXIV.Client.UI; using ImGuiNET; +using Serilog; namespace Dalamud.Interface.Windowing; @@ -284,7 +286,14 @@ public abstract class Window if (this.ShowCloseButton ? ImGui.Begin(this.WindowName, ref this.internalIsOpen, this.Flags) : ImGui.Begin(this.WindowName, this.Flags)) { // Draw the actual window contents - this.Draw(); + try + { + this.Draw(); + } + catch (Exception ex) + { + Log.Error(ex, $"Error during Draw(): {this.WindowName}"); + } } if (wasFocused)