Skip to content

Commit ea53f5d

Browse files
committed
Fix potential force unwrapping of nil in debug logging when reconnecting
1 parent 96b75ea commit ea53f5d

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

PusherSwift/PusherSwift.xcodeproj/project.pbxproj

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@
6666
33BB998E1D21230300B25C2A /* PusherConnectionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33BB99641D21226C00B25C2A /* PusherConnectionTests.swift */; };
6767
33BB998F1D21230300B25C2A /* PusherIncomingEventHandlingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33BB99651D21226C00B25C2A /* PusherIncomingEventHandlingTests.swift */; };
6868
33BB99901D21230300B25C2A /* PusherTopLevelAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33BB99661D21226C00B25C2A /* PusherTopLevelAPITests.swift */; };
69-
33BB99911D21230A00B25C2A /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 33BB99671D21226C00B25C2A /* Info.plist */; };
70-
33BB99921D21230B00B25C2A /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 33BB99671D21226C00B25C2A /* Info.plist */; };
71-
33BB99931D21230C00B25C2A /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 33BB99671D21226C00B25C2A /* Info.plist */; };
72-
33BB99941D21231300B25C2A /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 33831C8D1A9CF61600B124F1 /* Info.plist */; };
73-
33BB99951D21231400B25C2A /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 33831C8D1A9CF61600B124F1 /* Info.plist */; };
74-
33BB99961D21231400B25C2A /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 33831C8D1A9CF61600B124F1 /* Info.plist */; };
7569
33C0D2D51CB5C1F2003FE13E /* CryptoSwiftHMACModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33C0D2D41CB5C1F2003FE13E /* CryptoSwiftHMACModule.swift */; };
7670
33C0D2D61CB5C1F2003FE13E /* CryptoSwiftHMACModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33C0D2D41CB5C1F2003FE13E /* CryptoSwiftHMACModule.swift */; };
7771
33C0D2D71CB5C1F2003FE13E /* CryptoSwiftHMACModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33C0D2D41CB5C1F2003FE13E /* CryptoSwiftHMACModule.swift */; };
@@ -528,7 +522,7 @@
528522
isa = PBXProject;
529523
attributes = {
530524
LastSwiftUpdateCheck = 0700;
531-
LastUpgradeCheck = 0720;
525+
LastUpgradeCheck = 0730;
532526
TargetAttributes = {
533527
33831C881A9CF61600B124F1 = {
534528
CreatedOnToolsVersion = 6.3;
@@ -568,47 +562,41 @@
568562
isa = PBXResourcesBuildPhase;
569563
buildActionMask = 2147483647;
570564
files = (
571-
33BB99951D21231400B25C2A /* Info.plist in Resources */,
572565
);
573566
runOnlyForDeploymentPostprocessing = 0;
574567
};
575568
337C9F1B1C394197006CC757 /* Resources */ = {
576569
isa = PBXResourcesBuildPhase;
577570
buildActionMask = 2147483647;
578571
files = (
579-
33BB99961D21231400B25C2A /* Info.plist in Resources */,
580572
);
581573
runOnlyForDeploymentPostprocessing = 0;
582574
};
583575
33831C871A9CF61600B124F1 /* Resources */ = {
584576
isa = PBXResourcesBuildPhase;
585577
buildActionMask = 2147483647;
586578
files = (
587-
33BB99941D21231300B25C2A /* Info.plist in Resources */,
588579
);
589580
runOnlyForDeploymentPostprocessing = 0;
590581
};
591582
33831C921A9CF61600B124F1 /* Resources */ = {
592583
isa = PBXResourcesBuildPhase;
593584
buildActionMask = 2147483647;
594585
files = (
595-
33BB99911D21230A00B25C2A /* Info.plist in Resources */,
596586
);
597587
runOnlyForDeploymentPostprocessing = 0;
598588
};
599589
33999D271C401F9600AFED30 /* Resources */ = {
600590
isa = PBXResourcesBuildPhase;
601591
buildActionMask = 2147483647;
602592
files = (
603-
33BB99921D21230B00B25C2A /* Info.plist in Resources */,
604593
);
605594
runOnlyForDeploymentPostprocessing = 0;
606595
};
607596
33999D391C4020A300AFED30 /* Resources */ = {
608597
isa = PBXResourcesBuildPhase;
609598
buildActionMask = 2147483647;
610599
files = (
611-
33BB99931D21230C00B25C2A /* Info.plist in Resources */,
612600
);
613601
runOnlyForDeploymentPostprocessing = 0;
614602
};

Source/PusherWebsocketDelegate.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ extension PusherConnection: WebSocketDelegate {
8686
let timeInterval = maxReconnectGapInSeconds != nil ? min(reconnectInterval, maxReconnectGapInSeconds!)
8787
: reconnectInterval
8888

89-
self.debugLogger?("[PUSHER DEBUG] Waiting \(timeInterval) seconds before attempting to reconnect (attempt \(reconnectAttempts + 1) of \(reconnectAttemptsMax!))")
89+
if reconnectAttemptsMax != nil {
90+
self.debugLogger?("[PUSHER DEBUG] Waiting \(timeInterval) seconds before attempting to reconnect (attempt \(reconnectAttempts + 1) of \(reconnectAttemptsMax!))")
91+
} else {
92+
self.debugLogger?("[PUSHER DEBUG] Waiting \(timeInterval) seconds before attempting to reconnect (attempt \(reconnectAttempts + 1))")
93+
}
9094

9195
reconnectTimer = NSTimer.scheduledTimerWithTimeInterval(
9296
timeInterval,

0 commit comments

Comments
 (0)