fix: may avoid rare crashes

This commit is contained in:
Louis Pontoise committed 2022-06-22 01:04:36 +09:00
1 parent bfcbaacec7
commit e32beea00a
1 file changed
+4 -3
+4 -3
View File
@@ -95,9 +95,10 @@ class Window {
}
func refreshThumbnail() {
guard let cgWindowId = cgWindowId, let cgImage = cgWindowId.screenshot() else { return }
thumbnail = NSImage(cgImage: cgImage, size: NSSize(width: cgImage.width, height: cgImage.height))
thumbnailFullSize = thumbnail!.size
if !isWindowlessApp, let cgWindowId = cgWindowId, cgWindowId != -1, let cgImage = cgWindowId.screenshot() {
thumbnail = NSImage(cgImage: cgImage, size: NSSize(width: cgImage.width, height: cgImage.height))
thumbnailFullSize = thumbnail!.size
}
}
func close() {