don't force unwrap on making Engine.PacketType

This commit is contained in:
Erik 2015-04-13 16:04:51 -04:00
parent f87ed47723
commit 8d9580900f

View File

@ -84,8 +84,8 @@ public final class SocketEngine: NSObject, WebSocketDelegate, SocketLogClient {
case NOOP = 6 case NOOP = 6
init?(str:String?) { init?(str:String?) {
if let value = str?.toInt() { if let value = str?.toInt(), raw = PacketType(rawValue: value) {
self = PacketType(rawValue: value)! self = raw
} else { } else {
return nil return nil
} }