From faa797c7439cec666d5fb3b69db7cf11bc453c07 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Mon, 1 May 2017 11:13:24 -0400 Subject: [PATCH] Fix crash when placing call // FREEBIE --- Signal/src/call/OutboundCallInitiator.swift | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Signal/src/call/OutboundCallInitiator.swift b/Signal/src/call/OutboundCallInitiator.swift index c4e76661f..b0c1943c2 100644 --- a/Signal/src/call/OutboundCallInitiator.swift +++ b/Signal/src/call/OutboundCallInitiator.swift @@ -50,13 +50,15 @@ import Foundation // Alternative way without prompting for permissions: // if AVAudioSession.sharedInstance().recordPermission() == .denied { AVAudioSession.sharedInstance().requestRecordPermission { isGranted in - // Here the permissions are either granted or denied - guard isGranted == true else { - Logger.warn("\(self.TAG) aborting due to missing microphone permissions.") - self.showNoMicrophonePermissionAlert() - return + DispatchQueue.main.async { + // Here the permissions are either granted or denied + guard isGranted == true else { + Logger.warn("\(self.TAG) aborting due to missing microphone permissions.") + self.showNoMicrophonePermissionAlert() + return + } + callUIAdapter.startAndShowOutgoingCall(recipientId: recipientId) } - callUIAdapter.startAndShowOutgoingCall(recipientId: recipientId) } return true }