Skip to content

Commit eeaa6f9

Browse files
committed
add null check before updateresultmanifest
1 parent 1ec5023 commit eeaa6f9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ public static async Task<List<Result>> QueryForPlugin(PluginPair pair, Query que
183183
throw new ArgumentOutOfRangeException();
184184
}
185185
token.ThrowIfCancellationRequested();
186+
if (results == null)
187+
return results;
186188
UpdatePluginMetadata(results, metadata, query);
187189

188190
metadata.QueryCount += 1;

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ private void QueryContextMenu()
363363
}
364364

365365
if (!match.IsSearchPrecisionScoreMet()) return false;
366-
366+
367367
r.Score = match.Score;
368368
return true;
369369

@@ -512,7 +512,7 @@ async Task QueryTask(PluginPair plugin)
512512
await Task.Yield();
513513

514514
var results = await PluginManager.QueryForPlugin(plugin, query, currentCancellationToken);
515-
if (!currentCancellationToken.IsCancellationRequested)
515+
if (!currentCancellationToken.IsCancellationRequested && results != null)
516516
_resultsUpdateQueue.Post(new ResultsForUpdate(results, plugin.Metadata, query,
517517
currentCancellationToken));
518518
}

0 commit comments

Comments
 (0)