Skip to content

Commit e4ca04a

Browse files
committed
Bug fix
#3851
1 parent d0f7ece commit e4ca04a

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

V2rayNG/app/src/main/kotlin/com/v2ray/ang/handler/MigrateManager.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ object MigrateManager {
3636

3737
//check and remove old
3838
decodeServerConfig(guid) ?: continue
39-
serverStorage.remove(guid)
39+
//serverStorage.remove(guid)
4040
Log.d(ANG_PACKAGE, "migrateServerConfig2Profile-" + config.remarks)
4141
}
4242
Log.d(ANG_PACKAGE, "migrateServerConfig2Profile-end")

V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayServiceManager.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ object V2RayServiceManager {
6565
if (v2rayPoint.isRunning) return
6666
val guid = MmkvManager.getSelectServer() ?: return
6767
val config = MmkvManager.decodeServerConfig(guid) ?: return
68-
if (!Utils.isValidUrl(config.server) && !Utils.isValidUrl(config.server)) return
68+
if (!Utils.isValidUrl(config.server) && !Utils.isIpAddress(config.server)) return
6969
// val result = V2rayConfigUtil.getV2rayConfig(context, guid)
7070
// if (!result.status) return
7171

V2rayNG/app/src/main/kotlin/com/v2ray/ang/util/Utils.kt

+4-1
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,11 @@ object Utils {
159159
/**
160160
* is ip address
161161
*/
162-
fun isIpAddress(value: String): Boolean {
162+
fun isIpAddress(value: String?): Boolean {
163163
try {
164+
if (value.isNullOrEmpty()) {
165+
return false
166+
}
164167
var addr = value
165168
if (addr.isEmpty() || addr.isBlank()) {
166169
return false

0 commit comments

Comments
 (0)