diff --git a/macos/Sources/Ghostty/InspectorView.swift b/macos/Sources/Ghostty/InspectorView.swift index 1b1d7270f..074431274 100644 --- a/macos/Sources/Ghostty/InspectorView.swift +++ b/macos/Sources/Ghostty/InspectorView.swift @@ -426,6 +426,10 @@ extension Ghostty { return } + // If the inspector is nil, then our surface is freed and it is unsafe + // to use. + guard let inspector = self.inspector else { return } + // We always update our size because sometimes draw is called // between resize events and if our size is wrong with the underlying // drawable we will crash.