Fixes NPE when activity is destroyed by OS (#402)

Closes #402.
This commit is contained in:
Miguel Ruivo 2020-09-28 21:41:59 +01:00
parent 0609cae84a
commit d2ecbd3d30
3 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,6 @@
## 2.0.5
Android: Fixes [#402](https://github.com/miguelpruivo/flutter_file_picker/issues/402).
## 2.0.4
Desktop (Go): Fixes directory pick on Linux.

View File

@ -73,6 +73,10 @@ public class FilePickerDelegate implements PluginRegistry.ActivityResultListener
@Override
public boolean onActivityResult(final int requestCode, final int resultCode, final Intent data) {
if(type == null) {
return false;
}
if (requestCode == REQUEST_CODE && resultCode == Activity.RESULT_OK) {
if (eventSink != null) {

View File

@ -1,7 +1,7 @@
name: file_picker
description: A package that allows you to use a native file explorer to pick single or multiple absolute file paths, with extension filtering support.
homepage: https://github.com/miguelpruivo/plugins_flutter_file_picker
version: 2.0.4
version: 2.0.5
dependencies:
flutter: