Skip to content

Commit d0b9b0f

Browse files
committed
nullpointer safety, kotlin 1.2.71
1 parent e24a6dc commit d0b9b0f

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Release Settings
2-
kotlinVersion=1.2.61
2+
kotlinVersion=1.2.71
33
okhttpVersion=3.10.0
44
retrofitVersion=2.3.0
55

66
GROUP=com.andretietz.retroauth
7-
VERSION_NAME=3.0.0-beta7-SNAPSHOT
7+
VERSION_NAME=3.0.0-beta8-SNAPSHOT
88
POM_DESCRIPTION=A library build on top of retrofit, for simple handling of authenticated requests.
99
POM_URL=https://github.com/andretietz/retroauth
1010
POM_SCM_URL=https://github.com/andretietz/retroauth

retroauth-android/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Dependencies
44
* [Retrofit](https://github.com/square/retrofit) 2.3.0 (transitive from retroauth-core)
55
* appcompat-v7 23.0.0
6-
* kotlin-stdlib 1.2.30
6+
* kotlin-stdlib 1.2.71
77

88
Method-Count: 348
99
Field-Count: 77

retroauth-android/src/main/java/com/andretietz/retroauth/AndroidOwnerManager.kt

+6-9
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import android.accounts.AccountManagerCallback
2222
import android.accounts.AccountManagerFuture
2323
import android.app.AlertDialog
2424
import android.app.Application
25-
import android.app.Dialog
2625
import android.content.Context
2726
import android.os.Build
2827
import android.os.Bundle
@@ -189,14 +188,12 @@ class AndroidOwnerManager constructor(
189188
val dialog = builder.create()
190189
dialog.setOnDismissListener { countDownLatch.countDown() }
191190
dialog.show()
192-
keep(dialog)
193-
}
194-
195-
private fun keep(dialog: Dialog) {
196-
dialog.window.attributes = WindowManager.LayoutParams().apply {
197-
copyFrom(dialog.window.attributes)
198-
width = WindowManager.LayoutParams.WRAP_CONTENT
199-
height = WindowManager.LayoutParams.WRAP_CONTENT
191+
dialog.window?.let { window ->
192+
window.attributes = WindowManager.LayoutParams().apply {
193+
copyFrom(window.attributes)
194+
width = WindowManager.LayoutParams.WRAP_CONTENT
195+
height = WindowManager.LayoutParams.WRAP_CONTENT
196+
}
200197
}
201198
}
202199
}

0 commit comments

Comments
 (0)