don't crash if nsp starts with /

This commit is contained in:
Erik 2015-03-27 12:21:05 -04:00
parent 18a561f78a
commit c4731dc298

View File

@ -103,7 +103,11 @@ public class SocketIOClient: NSObject, SocketEngineClient {
self.reconnectWait = abs(reconnectWait) 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 self.nsp = nsp
} }