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

@@ -407,6 +407,8 @@ class ImageHelper {
Bitmap bm;
int scaleToPixels = res.getDisplayMetrics().widthPixels;
try (InputStream is = context.getContentResolver().openInputStream(uri)) {
if (is == null)
throw new FileNotFoundException(uri.toString());
bm = getScaledBitmap(is, a.source, null, scaleToPixels);
if (bm == null)
throw new FileNotFoundException(a.source);