macos: verify inspector is not nil before sending it to draw

This commit is contained in:
Mitchell Hashimoto
2023-12-29 07:53:20 -08:00
parent 5cef3ced18
commit 6532ff73a8

View File

@ -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.