From b8d3b42295d557784e5ab990a927e612f7fd4872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Sat, 5 Dec 2020 15:48:36 +0800 Subject: [PATCH] use singleordefault instead of single since sometims the queue may be empty but method doesn't return --- Flow.Launcher/ViewModel/MainViewModel.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 1329421c3..25768a25e 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -724,7 +724,8 @@ namespace Flow.Launcher.ViewModel try { - token = resultsForUpdates.Select(r => r.Token).Distinct().Single(); + // Don't know why sometimes even resultsForUpdates is empty, the method won't return; + token = resultsForUpdates.Select(r => r.Token).Distinct().SingleOrDefault(); } #if DEBUG catch