X-Git-Url: https://code.octet-stream.net/netwatcher/blobdiff_plain/9ea683eddb05362f02bca60e4337955dfc5871dc..244781f32194c2498ef0e3b8225a9ff9791624af:/src/watch_win.rs?ds=sidebyside diff --git a/src/watch_win.rs b/src/watch_win.rs index 41612b8..a225f4a 100644 --- a/src/watch_win.rs +++ b/src/watch_win.rs @@ -81,7 +81,10 @@ unsafe extern "system" fn notif( ) { let state_ptr = ctx as *const Mutex; unsafe { - let state_guard = &mut *state_ptr.as_ref().unwrap().lock().unwrap(); + let state_guard = &mut *state_ptr.as_ref() + .expect("callback ctx should never be null") + .lock() + .unwrap(); handle_notif(state_guard); } }