diff options
| -rw-r--r-- | ios/MullvadVPN/AutomaticKeyRotationManager.swift | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ios/MullvadVPN/AutomaticKeyRotationManager.swift b/ios/MullvadVPN/AutomaticKeyRotationManager.swift index 350ef6aa80..b605b7e3da 100644 --- a/ios/MullvadVPN/AutomaticKeyRotationManager.swift +++ b/ios/MullvadVPN/AutomaticKeyRotationManager.swift @@ -239,7 +239,11 @@ class AutomaticKeyRotationManager { private func scheduleRetry(wallDeadline: DispatchWallTime) { let timerSource = DispatchSource.makeTimerSource(queue: dispatchQueue) timerSource.setEventHandler { [weak self] in - self?.performKeyRotation() + guard let self = self else { return } + + if self.isAutomaticRotationEnabled { + self.performKeyRotation() + } } timerSource.schedule(wallDeadline: wallDeadline) |
