diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/SearchHelper/WindowsSearchAPI.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/SearchHelper/WindowsSearchAPI.cs index a47a2281a0..d831e6a787 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/SearchHelper/WindowsSearchAPI.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Indexer/SearchHelper/WindowsSearchAPI.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Text.RegularExpressions; using Microsoft.Search.Interop; +using Wox.Plugin.Logger; namespace Microsoft.Plugin.Indexer.SearchHelper { @@ -49,7 +50,12 @@ namespace Microsoft.Plugin.Indexer.SearchHelper // # is URI syntax for the fragment component, need to be encoded so LocalPath returns complete path // Using OrdinalIgnoreCase since this is internal and used with symbols var string_path = ((string)oleDBResult.FieldData[0]).Replace("#", "%23", StringComparison.OrdinalIgnoreCase); - var uri_path = new Uri(string_path); + + if (!Uri.TryCreate(string_path, UriKind.RelativeOrAbsolute, out Uri uri_path)) + { + Log.Warn($"Failed to parse URI '${string_path}'", typeof(WindowsSearchAPI)); + continue; + } var result = new SearchResult {