mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 12:18:50 +02:00
Re add fix sequence empty exception on calling max in program plugin (#6054)
This commit is contained in:
committed by
GitHub
parent
2a7bf7fb5b
commit
69cb20e1cd
@@ -87,8 +87,11 @@ namespace Microsoft.Plugin.Program
|
|||||||
.Select(p => p.Result(query.Search, _context.API));
|
.Select(p => p.Result(query.Search, _context.API));
|
||||||
|
|
||||||
var result = results1.Concat(results2).Where(r => r != null && r.Score > 0);
|
var result = results1.Concat(results2).Where(r => r != null && r.Score > 0);
|
||||||
var maxScore = result.Max(x => x.Score);
|
if (result.Any())
|
||||||
result = result.Where(x => x.Score > Settings.MinScoreThreshold * maxScore);
|
{
|
||||||
|
var maxScore = result.Max(x => x.Score);
|
||||||
|
result = result.Where(x => x.Score > Settings.MinScoreThreshold * maxScore);
|
||||||
|
}
|
||||||
|
|
||||||
return result.ToList();
|
return result.ToList();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user