don't force unwrap on making Engine.PacketType
This commit is contained in:
parent
f87ed47723
commit
8d9580900f
@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user