diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/util/Utils.kt b/mobile/src/main/java/be/mygod/vpnhotspot/util/Utils.kt index 9e81b99e..df82ddc6 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/util/Utils.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/util/Utils.kt @@ -168,5 +168,5 @@ fun if_nametoindex(ifname: String) = if (Build.VERSION.SDK_INT >= 26) { } else try { File("/sys/class/net/$ifname/ifindex").inputStream().bufferedReader().use { it.readLine().toInt() } } catch (_: FileNotFoundException) { - NetworkInterface.getByName(ifname).index + NetworkInterface.getByName(ifname)?.index ?: 0 }