From 1e580843ffce57e2ee8dd34e71f7c04e449abc30 Mon Sep 17 00:00:00 2001 From: Kang Yu Date: Sun, 18 Aug 2024 15:23:09 -0700 Subject: [PATCH] fix exception when capture new windows --- .../Common/PersistentWindowProcessor.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs index cff4896..c14bb3a 100644 --- a/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs +++ b/Ninjacrab.PersistentWindows.Solution/Common/PersistentWindowProcessor.cs @@ -1180,6 +1180,9 @@ namespace PersistentWindows.Common if (string.IsNullOrEmpty(className)) return -1; + if (!windowProcessName.ContainsKey(hwnd)) + return -1; + string procName = windowProcessName[hwnd]; string title = GetWindowTitle(hwnd); if (className.Equals("ApplicationFrameWindow"))