From 0ff12b9aa9e7c5f3b86da4e295669e0b1f6eb9ed Mon Sep 17 00:00:00 2001 From: Mygod Date: Tue, 25 Dec 2018 23:42:52 +0800 Subject: [PATCH] Handle NullPointerExceptions --- mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbour.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbour.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbour.kt index 54dce7d9..a3bd0ab7 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbour.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/IpNeighbour.kt @@ -6,7 +6,6 @@ import java.io.File import java.io.IOException import java.net.InetAddress import java.net.NetworkInterface -import java.net.SocketException data class IpNeighbour(val ip: InetAddress, val dev: String, val lladdr: String, val state: State) { enum class State { @@ -55,7 +54,7 @@ data class IpNeighbour(val ip: InetAddress, val dev: String, val lladdr: String, if (devParser != null) try { return listOf(IpNeighbour(ip, NetworkInterface.getByIndex(devParser.groupValues[1].toInt()).name, lladdr, state), result) - } catch (e: SocketException) { + } catch (e: RuntimeException) { Timber.w(e) } listOf(result)