Prevent simultaneous incoming and outgoing calls from leaving CallService in a bad state.

// FREEBIE
pull/1/head
Matthew Chen 8 years ago
parent 19aa4b5b8c
commit 5687925513

@ -230,6 +230,13 @@ protocol CallServiceObserver: class {
public func handleOutgoingCall(_ call: SignalCall) -> Promise<Void> {
AssertIsOnMainThread()
guard self.call == nil else {
let errorDescription = "\(TAG) call was unexpectedly already set."
Logger.error(errorDescription)
call.state = .localFailure
return Promise(error: CallError.assertionError(description: errorDescription))
}
self.call = call
let thread = TSContactThread.getOrCreateThread(contactId: call.remotePhoneNumber)

Loading…
Cancel
Save