Fix a potential crash when trying to send a nil chunk file (in case of stop immediately after pause)

This commit is contained in:
Philippe Loriaux
2022-10-20 17:40:04 +02:00
parent 1c5e011fbe
commit 1309584ed8
@@ -86,7 +86,9 @@ class VoiceBroadcastRecorderService: VoiceBroadcastRecorderServiceProtocol {
self.serviceDelegate?.voiceBroadcastRecorderService(self, didUpdateState: .stopped)
// Send current chunk
self.sendChunkFile(at: self.chunkFile.url, sequence: self.chunkFileNumber)
if self.chunkFile != nil {
self.sendChunkFile(at: self.chunkFile.url, sequence: self.chunkFileNumber)
}
self.session.tearDownVoiceBroadcastService()
}, failure: { error in