diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-09-16 10:44:50 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-09-16 10:44:50 +0200 |
commit | abcb51d2a680ac254bba1bc2ff223462fefde649 (patch) | |
tree | 90d865a92a0858d49fc3a8955fb8ac532f712aff | |
parent | 8b9a40b3d751cf723c822e3ca317735a99f09cab (diff) |
Extensions: use more idiomatic kotlin
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | ui/src/main/java/com/wireguard/android/util/Extensions.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/src/main/java/com/wireguard/android/util/Extensions.kt b/ui/src/main/java/com/wireguard/android/util/Extensions.kt index 9106ec77..c8892295 100644 --- a/ui/src/main/java/com/wireguard/android/util/Extensions.kt +++ b/ui/src/main/java/com/wireguard/android/util/Extensions.kt @@ -25,7 +25,7 @@ fun Fragment.requireTargetFragment(): Fragment { } val Preference.activity: SettingsActivity - get() = if (this.context is SettingsActivity) this.context as SettingsActivity else throw IllegalStateException("Failed to resolve SettingsActivity") + get() = context as? SettingsActivity ?: throw IllegalStateException("Failed to resolve SettingsActivity") val Preference.lifecycleScope: CoroutineScope - get() = this.activity.lifecycleScope + get() = activity.lifecycleScope |