diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d4d621d..3fad94a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 8.1.3 +### Android +- Fixes a null object reference error [#1604](https://github.com/miguelpruivo/flutter_file_picker/issues/1604) + ## 8.1.2 ### Android - Fixes a cache deletion issue [#1505](https://github.com/miguelpruivo/flutter_file_picker/issues/1505) diff --git a/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerDelegate.java b/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerDelegate.java index 5e5eab17..0f0f6dd3 100644 --- a/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerDelegate.java +++ b/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerDelegate.java @@ -85,6 +85,9 @@ public boolean onActivityResult(final int requestCode, final int resultCode, fin // Save file if (requestCode == SAVE_FILE_CODE) { if (resultCode == Activity.RESULT_OK) { + if (data == null) { + return false; + } this.dispatchEventStatus(true); final Uri uri = data.getData(); if (uri != null) { diff --git a/pubspec.yaml b/pubspec.yaml index 155fc5a2..6624f78c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A package that allows you to use a native file explorer to pick sin homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker repository: https://github.com/miguelpruivo/flutter_file_picker issue_tracker: https://github.com/miguelpruivo/flutter_file_picker/issues -version: 8.1.2 +version: 8.1.3 dependencies: flutter: