浏览代码

Fixes #4214. Annoying sporadic System.NullReferenceException in WindowsConsole (#4215)

BDisp 1 月之前
父节点
当前提交
48d4de2e63
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Terminal.Gui/Drivers/WindowsDriver/WindowsConsole.cs

+ 1 - 1
Terminal.Gui/Drivers/WindowsDriver/WindowsConsole.cs

@@ -62,7 +62,7 @@ internal partial class WindowsConsole
         InputRecord inputRecord = default;
         uint numberEventsRead = 0;
 
-        while (!_inputReadyCancellationTokenSource!.IsCancellationRequested)
+        while (_inputReadyCancellationTokenSource is { IsCancellationRequested: false })
         {
             try
             {