mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-17 07:23:21 +01:00
Fix potential crash when saving to fallback attachment folder.
Fixes #14720
This commit is contained in:
committed by
jeffrey-signal
parent
7e4736969c
commit
eded335766
@@ -216,6 +216,9 @@ object SaveAttachmentUtil {
|
||||
} catch (e: RuntimeException) {
|
||||
if (e is IllegalArgumentException || e.cause is IllegalArgumentException) {
|
||||
Log.w(TAG, "Unable to create uri in $outputUri with mimeType [$mimeType]")
|
||||
if (Build.VERSION.SDK_INT > 28) {
|
||||
contentValues.put(MediaStore.MediaColumns.RELATIVE_PATH, Environment.DIRECTORY_DOWNLOADS + "/Signal")
|
||||
}
|
||||
CreateMediaUriResult(StorageUtil.getDownloadUri(), AppDependencies.application.contentResolver.insert(StorageUtil.getDownloadUri(), contentValues))
|
||||
} else {
|
||||
throw e
|
||||
|
||||
Reference in New Issue
Block a user