mirror of
https://github.com/status-im/react-native-image-crop-picker.git
synced 2025-02-22 10:28:23 +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,
|
cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs,
|
||||||
null);
|
null);
|
||||||
if (cursor != null && cursor.moveToFirst()) {
|
if (cursor != null && cursor.moveToFirst()) {
|
||||||
final int index = cursor.getColumnIndexOrThrow(MediaStore.MediaColumns.DATA);
|
// Fall back to writing to file if _data column does not exist
|
||||||
String path = cursor.getString(index);
|
final int index = cursor.getColumnIndex(MediaStore.MediaColumns.DATA);
|
||||||
|
String path = index > -1 ? cursor.getString(index) : null;
|
||||||
if (path != null) {
|
if (path != null) {
|
||||||
return cursor.getString(index);
|
return cursor.getString(index);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user