Skip to content

Commit

Permalink
Merge pull request #696 from mirokuratczyk/master
Browse files Browse the repository at this point in the history
Do not call nw_path_monitor_cancel on nil monitor
  • Loading branch information
rod-hynes authored Oct 1, 2024
2 parents e9a9b00 + 2526e54 commit 10ab761
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,10 @@ - (void)stop API_AVAILABLE(macos(10.14), ios(12.0), watchos(5.0), tvos(12.0)) {
// Note: this monitor cannot be used after being cancelled. Its update handler will not
// fire again and cannot be restarted with nw_path_monitor_start. A new monitor must be
// created and started.
nw_path_monitor_cancel(self->monitor);
self->monitor = nil;
if (self->monitor != nil) {
nw_path_monitor_cancel(self->monitor);
self->monitor = nil;
}
}
}

Expand Down

0 comments on commit 10ab761

Please sign in to comment.