From 2aefbd43ebeb36dda7779a46df868856219b35dc Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Fri, 1 May 2026 17:06:34 +0800 Subject: [PATCH] Suppress exceptions in RealPingWorkerService Wrap startRealPing(guid) in a catch(Throwable) that ignores errors so exceptions during measurement won't propagate. This ensures the finally block always runs to decrement totalCount and runningCount, preventing the worker from being interrupted by unexpected errors. --- .../main/java/com/v2ray/ang/service/RealPingWorkerService.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/V2rayNG/app/src/main/java/com/v2ray/ang/service/RealPingWorkerService.kt b/V2rayNG/app/src/main/java/com/v2ray/ang/service/RealPingWorkerService.kt index 5617f5de..fd7a45ea 100644 --- a/V2rayNG/app/src/main/java/com/v2ray/ang/service/RealPingWorkerService.kt +++ b/V2rayNG/app/src/main/java/com/v2ray/ang/service/RealPingWorkerService.kt @@ -41,6 +41,8 @@ class RealPingWorkerService( try { val result = startRealPing(guid) MessageUtil.sendMsg2UI(context, AppConfig.MSG_MEASURE_CONFIG_SUCCESS, Pair(guid, result)) + } catch (_: Throwable) { + // ignore } finally { val count = totalCount.decrementAndGet() val left = runningCount.decrementAndGet()