Skip to content

Commit

Permalink
Address warning
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharee committed Jun 28, 2024
1 parent 3a3ae06 commit 85a202b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/src/main/java/tk/zwander/wifilist/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,10 @@ class MainActivity : AppCompatActivity(),
}

@Suppress("UNCHECKED_CAST")
val privilegedConfigsList = if (privilegedConfigs != null) {
privilegedConfigs::class.java.getMethod("getList")
.invoke(privilegedConfigs) as List<WifiConfiguration>
} else {
listOf()
}
val privilegedConfigsList = privilegedConfigs?.let {
it::class.java.getMethod("getList")
.invoke(it) as List<WifiConfiguration>
} ?: listOf()

val items = privilegedConfigsList
.sortedBy { it.SSID.lowercase() }
Expand Down

0 comments on commit 85a202b

Please sign in to comment.