mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-30 05:44:51 +02:00
Check resolver input/output streams
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user