From c4731dc298ac06024046786498fde511a44378a3 Mon Sep 17 00:00:00 2001 From: Erik Date: Fri, 27 Mar 2015 12:21:05 -0400 Subject: [PATCH] don't crash if nsp starts with / --- SwiftIO/SocketIOClient.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SwiftIO/SocketIOClient.swift b/SwiftIO/SocketIOClient.swift index dd78211..337aa45 100644 --- a/SwiftIO/SocketIOClient.swift +++ b/SwiftIO/SocketIOClient.swift @@ -103,7 +103,11 @@ public class SocketIOClient: NSObject, SocketEngineClient { self.reconnectWait = abs(reconnectWait) } - if let nsp = opts!["nsp"] as? String { + if var nsp = opts!["nsp"] as? String { + if nsp.hasPrefix("/") { + nsp.removeAtIndex(nsp.startIndex) + } + self.nsp = nsp }