Skip to content

Commit

Permalink
cgl: fix error message when ns_window is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
tronical authored Sep 26, 2023
1 parent d0f280b commit b49a112
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions glutin/src/api/cgl/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@ impl Display {
};
let ns_view = MainThreadBound::new(ns_view, mtm);

let ns_window = if let Some(ns_window) =
unsafe { Id::retain(native_window.ns_window.cast()) }
{
ns_window
} else {
return Err(ErrorKind::NotSupported("ns_view of provided native window is nil").into());
};
let ns_window =
if let Some(ns_window) = unsafe { Id::retain(native_window.ns_window.cast()) } {
ns_window
} else {
return Err(
ErrorKind::NotSupported("ns_window of provided native window is nil").into()
);
};
let ns_window = MainThreadBound::new(ns_window, mtm);

let surface = Surface {
Expand Down

0 comments on commit b49a112

Please sign in to comment.