X-Git-Url: https://code.octet-stream.net/netwatcher/blobdiff_plain/9ea683eddb05362f02bca60e4337955dfc5871dc..7cbddf0b21f7cf98b46c66a430eb8221f3622d55:/src/watch_win.rs 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); } }