From eeaa6f920d6d223f97e49db9745354c31dda5ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Wed, 3 Feb 2021 17:50:21 +0800 Subject: [PATCH] add null check before updateresultmanifest --- Flow.Launcher.Core/Plugin/PluginManager.cs | 2 ++ Flow.Launcher/ViewModel/MainViewModel.cs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/PluginManager.cs b/Flow.Launcher.Core/Plugin/PluginManager.cs index 26167e945..700a7d509 100644 --- a/Flow.Launcher.Core/Plugin/PluginManager.cs +++ b/Flow.Launcher.Core/Plugin/PluginManager.cs @@ -183,6 +183,8 @@ namespace Flow.Launcher.Core.Plugin throw new ArgumentOutOfRangeException(); } token.ThrowIfCancellationRequested(); + if (results == null) + return results; UpdatePluginMetadata(results, metadata, query); metadata.QueryCount += 1; diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 05dbb3a8b..afbe6e197 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -363,7 +363,7 @@ namespace Flow.Launcher.ViewModel } if (!match.IsSearchPrecisionScoreMet()) return false; - + r.Score = match.Score; return true; @@ -512,7 +512,7 @@ namespace Flow.Launcher.ViewModel await Task.Yield(); var results = await PluginManager.QueryForPlugin(plugin, query, currentCancellationToken); - if (!currentCancellationToken.IsCancellationRequested) + if (!currentCancellationToken.IsCancellationRequested && results != null) _resultsUpdateQueue.Post(new ResultsForUpdate(results, plugin.Metadata, query, currentCancellationToken)); }