Permit p2pInterface to be null for whatever reasons
This commit is contained in:
@@ -89,7 +89,7 @@ class RepeaterFragment : Fragment(), ServiceConnection, Toolbar.OnMenuItemClickL
|
||||
}
|
||||
|
||||
inner class Client(p2p: WifiP2pDevice? = null, neighbour: IpNeighbour? = null) {
|
||||
val iface = neighbour?.dev ?: p2pInterface!!
|
||||
val iface = neighbour?.dev ?: p2pInterface
|
||||
val mac = p2p?.deviceAddress ?: neighbour?.lladdr!!
|
||||
val ip = TreeMap<String, IpNeighbour.State>()
|
||||
|
||||
|
||||
@@ -41,7 +41,8 @@ enum class TetherType {
|
||||
.map { it.toPattern() }
|
||||
}
|
||||
|
||||
fun ofInterface(iface: String, p2pDev: String? = null) = when {
|
||||
fun ofInterface(iface: String?, p2pDev: String? = null) = when {
|
||||
iface == null -> NONE
|
||||
iface == p2pDev -> WIFI_P2P
|
||||
usbRegexes.any { it.matcher(iface).matches() } -> USB
|
||||
wifiRegexes.any { it.matcher(iface).matches() } -> WIFI
|
||||
|
||||
Reference in New Issue
Block a user