Преглед изворни кода

display(qemu): do not crash when closing terminal too early

Fixes #5660
osy пре 1 година
родитељ
комит
26e56a10f3
1 измењених фајлова са 3 додато и 1 уклоњено
  1. 3 1
      Platform/macOS/Display/VMDisplayQemuDisplayController.swift

+ 3 - 1
Platform/macOS/Display/VMDisplayQemuDisplayController.swift

@@ -585,7 +585,9 @@ extension VMDisplayQemuWindowController {
     }
     
     @MainActor private func findWindow(for serial: CSPort) -> VMDisplayQemuWindowController? {
-        let id = configIdForSerial(serial)!
+        guard let id = configIdForSerial(serial) else {
+            return nil
+        }
         let secondaryWindows: [VMDisplayWindowController]
         if self is VMDisplayQemuTerminalWindowController && self.id == id {
             return self