add null check before updateresultmanifest

This commit is contained in:
弘韬 张 2021-02-03 17:50:21 +08:00
parent 1ec5023fc4
commit eeaa6f920d
2 changed files with 4 additions and 2 deletions

View file

@ -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;

View file

@ -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));
}