From 845ede323546f209f7e65e9261bdb705ec576f64 Mon Sep 17 00:00:00 2001 From: Mygod Date: Fri, 13 Jul 2018 17:57:46 +0800 Subject: [PATCH] Fix crash when getLinkProperties returns null --- .../src/main/java/be/mygod/vpnhotspot/net/InterfaceMonitor.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/InterfaceMonitor.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/InterfaceMonitor.kt index 64cacaed..40ced8f9 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/InterfaceMonitor.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/InterfaceMonitor.kt @@ -43,7 +43,7 @@ class InterfaceMonitor(val iface: String) : UpstreamMonitor() { private set private val dns get() = app.connectivity.allNetworks .map { app.connectivity.getLinkProperties(it) } - .singleOrNull { it.interfaceName == iface } + .singleOrNull { it?.interfaceName == iface } ?.dnsServers ?: emptyList() override fun registerCallbackLocked(callback: Callback): Boolean {