This constructor can return nil

seeing frequent crash in the wild on this line, maybe this is why?

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent 3ee1d5568c
commit aa268e36c2

@ -52,7 +52,8 @@ import Foundation
*/
public func initiateCall(handle: String) -> Bool {
Logger.info("\(TAG) in \(#function) with handle: \(handle)")
guard let recipientId = PhoneNumber(fromUserSpecifiedText: handle).toE164() else {
guard let recipientId = PhoneNumber(fromUserSpecifiedText: handle)?.toE164() else {
Logger.warn("\(TAG) unable to parse signalId from phone number: \(handle)")
return false
}

Loading…
Cancel
Save