File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
android/src/main/java/com/instabug/reactlibrary Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 5959import org .json .JSONObject ;
6060import org .json .JSONTokener ;
6161
62+ import java .io .File ;
6263import java .lang .reflect .InvocationTargetException ;
6364import java .lang .reflect .Method ;
6465import java .util .ArrayList ;
@@ -457,8 +458,10 @@ public void setVideoRecordingFloatingButtonPosition(String corner) {
457458 @ ReactMethod
458459 public void setFileAttachment (String fileUri , String fileNameWithExtension ) {
459460 try {
460- Uri uri = Uri .parse (fileUri );
461- Instabug .addFileAttachment (uri , fileNameWithExtension );
461+ File file = new File (fileUri );
462+ if (file .exists ()) {
463+ Instabug .addFileAttachment (Uri .fromFile (file ), fileNameWithExtension );
464+ }
462465 } catch (Exception e ) {
463466 e .printStackTrace ();
464467 }
You can’t perform that action at this time.
0 commit comments