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

@@ -506,6 +506,9 @@ public class FragmentBase extends Fragment {
os = context.getContentResolver().openOutputStream(uri);
is = new FileInputStream(file);
if (os == null)
throw new FileNotFoundException(uri.toString());
byte[] buffer = new byte[Helper.BUFFER_SIZE];
int read;
while ((read = is.read(buffer)) != -1)
@@ -592,6 +595,9 @@ public class FragmentBase extends Fragment {
os = context.getContentResolver().openOutputStream(document.getUri());
is = new FileInputStream(file);
if (os == null)
throw new FileNotFoundException(uri.toString());
byte[] buffer = new byte[Helper.BUFFER_SIZE];
int read;
while ((read = is.read(buffer)) != -1)