From 6f61b5437eaf425e073309f7252c8fa5ea908311 Mon Sep 17 00:00:00 2001 From: Nikita Lutsenko Date: Thu, 12 Aug 2021 16:41:46 -0700 Subject: [PATCH] Guard potential unavailability of NSStreamNetworkServiceTypeCallSignaling. --- SocketRocket/Internal/Utilities/SRURLUtilities.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SocketRocket/Internal/Utilities/SRURLUtilities.m b/SocketRocket/Internal/Utilities/SRURLUtilities.m index 84585dad6..2f66d8d93 100644 --- a/SocketRocket/Internal/Utilities/SRURLUtilities.m +++ b/SocketRocket/Internal/Utilities/SRURLUtilities.m @@ -68,9 +68,11 @@ extern BOOL SRURLRequiresSSL(NSURL *url) case NSURLNetworkServiceTypeVoice: networkServiceType = NSStreamNetworkServiceTypeVoice; break; - case NSURLNetworkServiceTypeCallSignaling: - networkServiceType = NSStreamNetworkServiceTypeCallSignaling; - break; + case NSURLNetworkServiceTypeCallSignaling: { + if (@available(iOS 10.0, tvOS 10.0, macOS 10.12, *)) { + networkServiceType = NSStreamNetworkServiceTypeCallSignaling; + } + } break; } return networkServiceType; }