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

@@ -1917,6 +1917,8 @@ public class Helper {
static long copy(Context context, Uri uri, File file) throws IOException {
try (InputStream is = context.getContentResolver().openInputStream(uri)) {
if (is == null)
throw new FileNotFoundException(uri.toString());
try (OutputStream os = new FileOutputStream(file)) {
return copy(is, os);
}