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 59
59
import org .json .JSONObject ;
60
60
import org .json .JSONTokener ;
61
61
62
+ import java .io .File ;
62
63
import java .lang .reflect .InvocationTargetException ;
63
64
import java .lang .reflect .Method ;
64
65
import java .util .ArrayList ;
@@ -457,8 +458,10 @@ public void setVideoRecordingFloatingButtonPosition(String corner) {
457
458
@ ReactMethod
458
459
public void setFileAttachment (String fileUri , String fileNameWithExtension ) {
459
460
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
+ }
462
465
} catch (Exception e ) {
463
466
e .printStackTrace ();
464
467
}
You can’t perform that action at this time.
0 commit comments