Skip to content

Commit

Permalink
Merge pull request #1410 from Haselnussbomber/catch-draw-exception
Browse files Browse the repository at this point in the history
  • Loading branch information
goaaats committed Sep 21, 2023
2 parents 979a546 + cec382d commit 035ee00
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Dalamud/Interface/Windowing/Window.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System;
using System.Numerics;

using Dalamud.Configuration.Internal;
using Dalamud.Game.ClientState.Keys;
using Dalamud.Logging.Internal;
using FFXIVClientStructs.FFXIV.Client.UI;
using ImGuiNET;

Expand All @@ -12,6 +14,8 @@ namespace Dalamud.Interface.Windowing;
/// </summary>
public abstract class Window
{
private static readonly ModuleLog Log = new("WindowSystem");

private static bool wasEscPressedLastFrame = false;

private bool internalLastIsOpen = false;
Expand Down Expand Up @@ -284,7 +288,14 @@ internal void DrawInternal(DalamudConfiguration? configuration)
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)
Expand Down

0 comments on commit 035ee00

Please sign in to comment.