fix nullref on unclean shutdown (#1725)

This commit is contained in:
Wouter Tinus
2022-05-16 22:57:53 +02:00
committed by GitHub
parent eb0e5003a6
commit a5e355c5e2

View File

@@ -1892,8 +1892,11 @@ namespace Terminal.Gui {
void IMainLoopDriver.MainIteration ()
{
while (resultQueue.Count > 0) {
var inputEvent = resultQueue.Dequeue () [0];
ProcessInput?.Invoke (inputEvent);
var inputRecords = resultQueue.Dequeue ();
if (inputRecords != null && inputRecords.Length > 0) {
var inputEvent = inputRecords [0];
ProcessInput?.Invoke (inputEvent);
}
}
if (winChanged) {
winChanged = false;