Skip to content

Commit 5493e5c

Browse files
committed
Fix null exception
1 parent 1c0c9e7 commit 5493e5c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,10 @@ private static List<Result> GetHistoryItems(IEnumerable<HistoryItem> historyItem
13331333

13341334
private async Task QueryResultsAsync(bool searchDelay, bool isReQuery = false, bool reSelect = true)
13351335
{
1336-
await _updateSource?.CancelAsync();
1336+
if (_updateSource != null)
1337+
{
1338+
await _updateSource.CancelAsync();
1339+
}
13371340
_progressQuery = null;
13381341

13391342
App.API.LogDebug(ClassName, $"Start query with text: <{QueryText}>");
@@ -1927,7 +1930,10 @@ public async Task SetupDialogJumpAsync(nint handle)
19271930
if (DialogJump.DialogJumpWindowPosition == DialogJumpWindowPositions.UnderDialog)
19281931
{
19291932
// Cancel the previous Dialog Jump task
1930-
await _dialogJumpSource?.CancelAsync();
1933+
if (_dialogJumpSource != null)
1934+
{
1935+
await _dialogJumpSource.CancelAsync();
1936+
}
19311937

19321938
// Create a new cancellation token source
19331939
_dialogJumpSource = new CancellationTokenSource();

0 commit comments

Comments
 (0)