diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterFragment.kt b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterFragment.kt index 13982132..082d7473 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterFragment.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/RepeaterFragment.kt @@ -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() diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt index 08e79668..db3966fd 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt @@ -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