mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-30 21:58:52 +02:00
Check resolver input/output streams
This commit is contained in:
@@ -266,6 +266,8 @@ public class ActivityEML extends ActivityBase {
|
||||
|
||||
ContentResolver resolver = context.getContentResolver();
|
||||
try (InputStream is = resolver.openInputStream(uri)) {
|
||||
if (is == null)
|
||||
throw new FileNotFoundException(uri.toString());
|
||||
|
||||
Properties props = MessageHelper.getSessionProperties();
|
||||
Session isession = Session.getInstance(props, null);
|
||||
@@ -534,6 +536,9 @@ public class ActivityEML extends ActivityBase {
|
||||
os = getContentResolver().openOutputStream(uri);
|
||||
is = apart.part.getInputStream();
|
||||
|
||||
if (os == null)
|
||||
throw new FileNotFoundException(uri.toString());
|
||||
|
||||
byte[] buffer = new byte[Helper.BUFFER_SIZE];
|
||||
int read;
|
||||
while ((read = is.read(buffer)) != -1)
|
||||
@@ -631,6 +636,8 @@ public class ActivityEML extends ActivityBase {
|
||||
|
||||
ContentResolver resolver = context.getContentResolver();
|
||||
try (InputStream is = resolver.openInputStream(uri)) {
|
||||
if (is == null)
|
||||
throw new FileNotFoundException(uri.toString());
|
||||
|
||||
Properties props = MessageHelper.getSessionProperties();
|
||||
Session isession = Session.getInstance(props, null);
|
||||
|
||||
Reference in New Issue
Block a user