diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 8a7d5c0d2..f964be795 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -1447,35 +1447,26 @@ namespace Flow.Launcher.ViewModel } #endif - try + foreach (var metaResults in resultsForUpdates) { - foreach (var metaResults in resultsForUpdates) + foreach (var result in metaResults.Results) { - foreach (var result in metaResults.Results) + if (_topMostRecord.IsTopMost(result)) { - if (_topMostRecord.IsTopMost(result)) - { - result.Score = int.MaxValue; - } - else - { - var priorityScore = metaResults.Metadata.Priority * 150; - result.Score += _userSelectedRecord.GetSelectedCount(result) + priorityScore; - } + result.Score = int.MaxValue; + } + else + { + var priorityScore = metaResults.Metadata.Priority * 150; + result.Score += _userSelectedRecord.GetSelectedCount(result) + priorityScore; } } - - // it should be the same for all results - bool reSelect = resultsForUpdates.First().ReSelectFirstResult; - - Results.AddResults(resultsForUpdates, token, reSelect); - } - catch (InvalidOperationException e) - { - // Plugin with IResultUpdate interface can somtimes throw this exception - // Collection was modified; enumeration operation may not execute - Log.Exception($"{nameof(MainViewModel)}.{nameof(UpdateResultView)}|UpdateResultView failed", e); } + + // it should be the same for all results + bool reSelect = resultsForUpdates.First().ReSelectFirstResult; + + Results.AddResults(resultsForUpdates, token, reSelect); } #endregion diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs index ce53c7da5..1bb96384c 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs @@ -85,7 +85,7 @@ namespace Flow.Launcher.Plugin.WebSearch ResultsUpdated?.Invoke(this, new ResultUpdatedEventArgs { - Results = results, + Results = results.ToList(), Query = query });