File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
lib/src/main/java/com/cloudinary/android/payload Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -30,15 +30,11 @@ public Object prepare(Context context) throws PayloadNotFoundException {
3030 }
3131
3232 private File getFile (Context context ) throws FileNotFoundException {
33- File file = new File (data );
33+ // check if data is an absolute path or a local app path and check if file exists:
34+ File file = data .contains (File .separator ) ? new File (data ) : context .getFileStreamPath (data );
3435
3536 if (!file .exists ()) {
36-
37- // check if it's a local app file:
38- file = context .getFileStreamPath (data );
39- if (!file .exists ()) {
40- throw new FileNotFoundException (String .format ("File '%s' does not exist" , data ));
41- }
37+ throw new FileNotFoundException (String .format ("File '%s' does not exist" , data ));
4238 }
4339
4440 return file ;
You can’t perform that action at this time.
0 commit comments