Return null in IP test if http port is 0 (#5537)

new name

Co-Authored-By: Copilot <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
hippo2025andCopilot authored and 2dust committed 2026-04-25 19:13:23 +08:00
1 parent 659f2ded09
commit b673167731
1 file changed
+1 -1
@@ -1,6 +1,5 @@
package com.v2ray.ang.handler
import android.content.Context
import android.os.SystemClock
import com.v2ray.ang.AppConfig
import com.v2ray.ang.R
@@ -90,6 +89,7 @@ object SpeedtestManager {
val proxyUsername = SettingsManager.getSocksUsername()
val proxyPassword = SettingsManager.getSocksPassword()
val httpPort = SettingsManager.getHttpPort()
if (httpPort == 0) return null
val content = HttpUtil.getUrlContent(url, 5000, httpPort, proxyUsername, proxyPassword) ?: return null
val ipInfo = JsonUtil.fromJson(content, IPAPIInfo::class.java) ?: return null