We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf5cb75 commit d7a5c50Copy full SHA for d7a5c50
crashlytics/Shared/ReachabililtyHelper.swift
@@ -60,10 +60,11 @@ class ReachabililtyHelper: NSObject {
60
* Add a hook to update network status going forward.
61
*/
62
func updateAndTrackNetworkStatus() {
63
- monitor.pathUpdateHandler = { path in
64
- let status = self.networkStatus(from: path)
65
- Crashlytics.crashlytics().setCustomValue(status, forKey: "network_connection")
66
- }
+ monitor.pathUpdateHandler = { [weak self] path in
+ guard let self = self else { return }
+ let status = self.networkStatus(from: path)
+ Crashlytics.crashlytics().setCustomValue(status, forKey: "network_connection")
67
+ }
68
let queue = DispatchQueue(label: "NetworkMonitor")
69
monitor.start(queue: queue)
70
}
0 commit comments