From d5ea712fac373cc02f765cec6ac6e21b6b02441b Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Sun, 29 Jan 2023 14:31:27 +0100 Subject: [PATCH] Pinger.kt: break out of the correct loop --- app/src/main/kotlin/d/d/meshenger/call/Pinger.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/d/d/meshenger/call/Pinger.kt b/app/src/main/kotlin/d/d/meshenger/call/Pinger.kt index 6682f44ac..bea1532d2 100644 --- a/app/src/main/kotlin/d/d/meshenger/call/Pinger.kt +++ b/app/src/main/kotlin/d/d/meshenger/call/Pinger.kt @@ -36,7 +36,6 @@ class Pinger(val binder: MainService.MainBinder, val contacts: List) : try { socket.connect(address, connectTimeout) connected = true - break } catch (e: ConnectException) { // target online, but Meshenger not running return Contact.State.APP_NOT_RUNNING @@ -44,6 +43,10 @@ class Pinger(val binder: MainService.MainBinder, val contacts: List) : // ignore } } + + if (connected) { + break + } } if (!connected) {