Check resolver input/output streams

This commit is contained in:
M66B
2022-03-27 13:43:45 +02:00
parent df3e0e132a
commit 1aa80a9258
16 changed files with 77 additions and 10 deletions

View File

@@ -157,6 +157,7 @@ import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -3595,6 +3596,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
try {
is = new FileInputStream(file);
os = resolver.openOutputStream(uri);
if (os == null)
throw new FileNotFoundException(uri.toString());
Helper.copy(is, os);
} finally {
try {