From 61c44bc0bdfb55bb2817c88d8bd4e3f7bea51a69 Mon Sep 17 00:00:00 2001 From: Jaex Date: Wed, 11 Aug 2021 05:31:31 +0300 Subject: [PATCH] Fixed tag check issue --- ShareX.HistoryLib/HistoryItem.cs | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/ShareX.HistoryLib/HistoryItem.cs b/ShareX.HistoryLib/HistoryItem.cs index 8a985fcf6..b7371a3e1 100644 --- a/ShareX.HistoryLib/HistoryItem.cs +++ b/ShareX.HistoryLib/HistoryItem.cs @@ -46,9 +46,31 @@ public class HistoryItem public Dictionary Tags { get; set; } [JsonIgnore, DisplayName("Tags[WindowTitle]")] - public string TagsWindowTitle => Tags?["WindowTitle"]; + public string TagsWindowTitle + { + get + { + if (Tags != null && Tags.TryGetValue("WindowTitle", out string value)) + { + return value; + } + + return null; + } + } [JsonIgnore, DisplayName("Tags[ProcessName]")] - public string TagsProcessName => Tags?["ProcessName"]; + public string TagsProcessName + { + get + { + if (Tags != null && Tags.TryGetValue("ProcessName", out string value)) + { + return value; + } + + return null; + } + } } } \ No newline at end of file