mirror of
https://github.com/status-im/react-native-image-crop-picker.git
synced 2025-02-21 18:08:15 +00:00
Fall back to writing to file if _data column does not exist (#817)
* Fall back to writting to file if _data column does not exist * Fix spelling
This commit is contained in:
parent
fab0164e1b
commit
a0e7f820c6
@ -146,8 +146,9 @@ class RealPathUtil {
|
||||
cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,
|
||||
null);
|
||||
if (cursor != null && cursor.moveToFirst()) {
|
||||
final int index = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATA);
|
||||
String path = cursor.getString(index);
|
||||
// Fall back to writing to file if _data column does not exist
|
||||
final int index = cursor.getColumnIndex(MediaStore.MediaColumns.DATA);
|
||||
String path = index > -1 ? cursor.getString(index) : null;
|
||||
if (path != null) {
|
||||
return cursor.getString(index);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user