Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[image_picker] fix error if pick image from yandex disk(dropbox) #1265

Merged
merged 2 commits into from
Mar 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/image_picker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.5.0+7
* Fix a crash when selecting images from yandex.disk and dropbox.

## 0.5.0+6

* Delete the original image if it was scaled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ private static String getDataColumn(
try {
cursor = context.getContentResolver().query(uri, projection, selection, selectionArgs, null);
if (cursor != null && cursor.moveToFirst()) {
final int column_index = cursor.getColumnIndexOrThrow(column);
final int column_index = cursor.getColumnIndex(column);

//yandex.disk and dropbox do not have _data column
if (column_index == -1) {
return null;
}

return cursor.getString(column_index);
}
} finally {
Expand Down
2 changes: 1 addition & 1 deletion packages/image_picker/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors:
- Flutter Team <[email protected]>
- Rhodes Davis Jr. <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker
version: 0.5.0+6
version: 0.5.0+7

flutter:
plugin:
Expand Down