Skip to content

Commit c8b9264

Browse files
committed
Correct guard condition when checking for maxReconnectAttempts
1 parent c68c1f0 commit c8b9264

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/PusherWebsocketDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extension PusherConnection: WebSocketDelegate {
5151
return updateConnectionState(.Disconnected)
5252
}
5353

54-
guard reconnectAttemptsMax != nil && reconnectAttempts < reconnectAttemptsMax! else {
54+
guard reconnectAttemptsMax == nil || reconnectAttempts < reconnectAttemptsMax! else {
5555
self.debugLogger?("[PUSHER DEBUG] Max reconnect attempts reached")
5656
return updateConnectionState(.Disconnected)
5757
}

0 commit comments

Comments
 (0)