diff --git a/README.md b/README.md index 8963a8dc..90225212 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Include the library in your ``build.gradle`` ```groovy dependencies{ - implementation 'com.karumi:dexter:6.0.0' + implementation 'com.karumi:dexter:6.0.1' } ``` diff --git a/dexter/src/main/java/com/karumi/dexter/DexterInstance.java b/dexter/src/main/java/com/karumi/dexter/DexterInstance.java index 2c4ad668..4e834016 100644 --- a/dexter/src/main/java/com/karumi/dexter/DexterInstance.java +++ b/dexter/src/main/java/com/karumi/dexter/DexterInstance.java @@ -271,8 +271,12 @@ private void onPermissionsChecked(Collection permissions) { synchronized (pendingPermissionsMutex) { pendingPermissions.removeAll(permissions); if (pendingPermissions.isEmpty()) { - activity.finish(); - activity = null; + // Just in case heck to avoid NPE if the OS destroys the activity before + // the permission is checked. Issues #243 and #221 + if (activity != null) { + activity.finish(); + activity = null; + } isRequestingPermission.set(false); rationaleAccepted.set(false); isShowingNativeDialog.set(false); diff --git a/gradle.properties b/gradle.properties index bb24ec09..be416bac 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ POM_NAME=Dexter POM_ARTIFACT_ID=dexter POM_PACKAGING=aar -VERSION_NAME=6.0.1-SNAPSHOT +VERSION_NAME=6.0.1 VERSION_CODE=600001 GROUP=com.karumi