Skip to content

Commit

Permalink
Prepare version 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkil committed Nov 13, 2018
1 parent 25ccd20 commit d63b946
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ Change Log
==========


## Version 1.0.3

_2018-11-13_

* Fixed crash if could not find result subject for permission.


## Version 1.0.2

_2018-10-25_
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Add the dependency

```groovy
dependencies {
compile 'com.github.jetradarmobile:mrbutler:1.0.2'
compile 'com.github.jetradarmobile:mrbutler:1.0.3'
}
```

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ buildscript {
'compileSdk': 28,
'minSdk' : 14,

'kotlin' : '1.2.71',
'appcompat' : '1.0.0',
'kotlin' : '1.3.0',
'appcompat' : '1.0.2',
'fragment' : '1.0.0',
'rxjava' : '2.2.3',
'rxrelay' : '2.1.0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package com.jetradar.permissions

import android.annotation.SuppressLint
import android.content.pm.PackageManager
import android.util.Log
import com.jakewharton.rxrelay2.PublishRelay
import io.reactivex.Observable
import io.reactivex.Single
Expand Down Expand Up @@ -77,7 +78,11 @@ abstract class PermissionsDelegate<in T : Any> : PermissionsHandler {
fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
if (requestCode != PERMISSIONS_REQUEST_CODE) return
permissions.forEachIndexed { index, permission ->
val resultSubject = checkNotNull(requestPermissionResultSubjects.remove(permission)) { "Could not find corresponding result subject" }
val resultSubject = requestPermissionResultSubjects.remove(permission)
if (resultSubject == null) {
Log.e("MrButler", "Could not find result subject for $permission")
return@forEachIndexed
}
val component = checkNotNull(componentRef?.get()) { "Component not attached" }
val isPermissionGranted = grantResults[index] == PackageManager.PERMISSION_GRANTED
resultSubject.onSuccess(
Expand Down

0 comments on commit d63b946

Please sign in to comment.