Merge pull request #7242 from vector-im/nimau/7240_voice_message_temp_file_not_deleted

Fix temporary file deletion for a voice message (#7240)
This commit is contained in:
Nicolas Mauri 2023-01-06 09:29:32 +01:00 committed by GitHub
commit daea28bf73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -364,7 +364,8 @@ public class VoiceMessageController: NSObject, VoiceMessageToolbarViewDelegate,
}
private func deleteRecordingAtURL(_ url: URL?) {
guard let url = url, FileManager.default.fileExists(atPath: url.absoluteString) else {
// Fix: use url.path instead of url.absoluteString when using FileManager otherwise the url seems to be percent encoded and the file is not found.
guard let url = url, FileManager.default.fileExists(atPath: url.path) else {
return
}