Skip to content

Commit

Permalink
Fix do not crash if NetworkState is null
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusPettersson98 committed Jan 28, 2025
1 parent bdd5396 commit 706e4c8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions talpid-routing/src/unix/android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ pub extern "system" fn Java_net_mullvad_talpid_ConnectivityListener_notifyDefaul
) {
let env = JnixEnv::from(env);

if network_state.is_null() {
// TODO: We might want to handle this more gracefully
log::debug!("Received NULL NetworkState");
return;
}
let network_state = NetworkState::from_java(&env, network_state);
let Some(tx) = &*ROUTE_UPDATES_TX.lock().unwrap() else {
// No sender has been registered
Expand Down

0 comments on commit 706e4c8

Please sign in to comment.