File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ version = "0.6.2"
39
39
optional = true
40
40
41
41
[target .'cfg(target_os = "macos")' .dependencies .objc2 ]
42
- version = " 0.5.2 "
42
+ version = " 0.6.0 "
43
43
optional = true
44
44
45
45
[dev-dependencies ]
Original file line number Diff line number Diff line change @@ -48,8 +48,11 @@ impl HasWindowHandle for Window {
48
48
sys:: video:: SDL_PROP_WINDOW_COCOA_WINDOW_POINTER ,
49
49
std:: ptr:: null_mut ( ) ,
50
50
) ;
51
- let ns_view = msg_send ! [ ns_window as * mut NSObject , contentView] ;
52
- let handle = AppKitWindowHandle :: new ( NonNull :: new_unchecked ( ns_view) ) ;
51
+ let ns_view: * mut NSObject = msg_send ! [ ns_window as * mut NSObject , contentView] ;
52
+ if ns_view. is_null ( ) {
53
+ return Err ( HandleError :: Unavailable ) ;
54
+ }
55
+ let handle = AppKitWindowHandle :: new ( NonNull :: new_unchecked ( ns_view. cast ( ) ) ) ;
53
56
let raw_window_handle = RawWindowHandle :: AppKit ( handle) ;
54
57
55
58
Ok ( WindowHandle :: borrow_raw ( raw_window_handle) )
You can’t perform that action at this time.
0 commit comments