kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix crash saving a FLAC file.
rodzic
da20e66ecd
commit
123ffe42c3
|
@ -103,6 +103,11 @@ public class SaveAttachmentTask extends ProgressDialogAsyncTask<SaveAttachmentTa
|
|||
Uri mediaUri = createOutputUri(outputUri, contentType, fileName);
|
||||
ContentValues updateValues = new ContentValues();
|
||||
|
||||
if (mediaUri == null) {
|
||||
Log.w(TAG, "Failed to create mediaUri for " + contentType);
|
||||
return null;
|
||||
}
|
||||
|
||||
try (InputStream inputStream = PartAuthority.getAttachmentStream(context, attachment.uri)) {
|
||||
|
||||
if (inputStream == null) {
|
||||
|
@ -176,7 +181,7 @@ public class SaveAttachmentTask extends ProgressDialogAsyncTask<SaveAttachmentTa
|
|||
return new File(fileName).getName();
|
||||
}
|
||||
|
||||
private Uri createOutputUri(@NonNull Uri outputUri, @NonNull String contentType, @NonNull String fileName)
|
||||
private @Nullable Uri createOutputUri(@NonNull Uri outputUri, @NonNull String contentType, @NonNull String fileName)
|
||||
throws IOException
|
||||
{
|
||||
String[] fileParts = getFileNameParts(fileName);
|
||||
|
|
Ładowanie…
Reference in New Issue