Skip to content

Commit

Permalink
Merge pull request #278 from bernhardoj/fix/failed-to-build-unique-file
Browse files Browse the repository at this point in the history
Android - Fix failed to build unique file crash
  • Loading branch information
RonRadtke authored Aug 4, 2023
2 parents 95b4163 + 56a715d commit 728bd81
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,12 @@ public static Uri createNewMediaFile(FileDescription file, MediaType mt, ReactAp

Uri mediauri = getMediaUri(mt);

// Keeps a handle to the new file's URI in case we need to modify it later.
return resolver.insert(mediauri, fileDetails);
try {
// Keeps a handle to the new file's URI in case we need to modify it later.
return resolver.insert(mediauri, fileDetails);
} catch (Exception e) {
return null;
}
} else {
File f = new File(relativePath + file.getFullPath());
if (true) {
Expand Down

0 comments on commit 728bd81

Please sign in to comment.