From c6e64837c3eb82808e983fb7aa0fa7eef7acc30e Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 5 Mar 2025 14:27:33 -0500 Subject: [PATCH] Don't crash if mouse moves while picking machine. --- .../Mac/Clock Signal/Documents/MachineDocument.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OSBindings/Mac/Clock Signal/Documents/MachineDocument.swift b/OSBindings/Mac/Clock Signal/Documents/MachineDocument.swift index 130498c67..912e62b3a 100644 --- a/OSBindings/Mac/Clock Signal/Documents/MachineDocument.swift +++ b/OSBindings/Mac/Clock Signal/Documents/MachineDocument.swift @@ -265,7 +265,7 @@ class MachineDocument: // Start forwarding best-effort updates. machine.start() - optionsFader.showTransiently(for: 1.0) + optionsFader?.showTransiently(for: 1.0) } } @@ -803,7 +803,7 @@ class MachineDocument: // MARK: - In-window panels (i.e. options, volume). - private var optionsFader: ViewFader! = nil + private var optionsFader: ViewFader? = nil internal func scanTargetView(_ view: CSScanTargetView, shouldTrackMousovers subview: NSView) -> Bool { return subview == self.volumeView || subview == self.optionsView @@ -811,12 +811,12 @@ class MachineDocument: internal func scanTargetViewDidMouseoverSubviews(_ view: CSScanTargetView) { // The OS mouse cursor became visible, so show the options. - optionsFader.animateIn() + optionsFader?.animateIn() } internal func scanTargetViewWouldHideOSMouseCursor(_ view: CSScanTargetView) { // The OS mouse cursor will be hidden, so hide the options if visible. - optionsFader.animateOut(delay: 0.0) + optionsFader?.animateOut(delay: 0.0) } // MARK: - Helpers for fading things in and out.