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
init?(str:String?) {
if let value = str?.toInt() {
self = PacketType(rawValue: value)!
if let value = str?.toInt(), raw = PacketType(rawValue: value) {
self = raw
} else {
return nil
}