From d2ebfff1174021af3172a591ef1346f561a82b52 Mon Sep 17 00:00:00 2001 From: ema Date: Thu, 23 Apr 2026 00:42:47 +0800 Subject: [PATCH] Log exception in WindowInteropHelperExtension --- .../ExtensionMethods/WindowInteropHelperExtension.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/QuickLook.Common/ExtensionMethods/WindowInteropHelperExtension.cs b/QuickLook.Common/ExtensionMethods/WindowInteropHelperExtension.cs index ad42745..7a93722 100644 --- a/QuickLook.Common/ExtensionMethods/WindowInteropHelperExtension.cs +++ b/QuickLook.Common/ExtensionMethods/WindowInteropHelperExtension.cs @@ -15,6 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +using QuickLook.Common.Helpers; using System; using System.Windows.Interop; @@ -30,9 +31,10 @@ public static class WindowInteropHelperExtension { return windowInteropHelper?.EnsureHandle() ?? IntPtr.Zero; } - catch + catch (Exception e) { // Returning 0 is fine, since this error usually only occurs when the window is already closed or being disposed. + ProcessHelper.WriteLog(e.ToString()); return IntPtr.Zero; } }