Fix possible null reference when query is cancelled

This commit is contained in:
Jack251970 2024-11-27 19:33:33 +08:00
parent 14f1a5a5f0
commit 129169e0a9

View file

@ -12,7 +12,7 @@ namespace Flow.Launcher.Storage
internal bool IsTopMost(Result result)
{
if (records.Count == 0 || !records.ContainsKey(result.OriginQuery.RawQuery))
if (records.Count == 0 || (result.OriginQuery != null && !records.ContainsKey(result.OriginQuery.RawQuery)))
{
return false;
}