diff --git a/V2rayNG/app/src/main/java/com/v2ray/ang/extension/_Ext.kt b/V2rayNG/app/src/main/java/com/v2ray/ang/extension/_Ext.kt index 2aa3b6c4..75e60923 100644 --- a/V2rayNG/app/src/main/java/com/v2ray/ang/extension/_Ext.kt +++ b/V2rayNG/app/src/main/java/com/v2ray/ang/extension/_Ext.kt @@ -168,7 +168,7 @@ inline fun Intent.serializable(key: String): T? = whe * * @return True if the CharSequence is not null and not empty, false otherwise. */ -fun CharSequence?.isNotNullEmpty(): Boolean = this != null && this.isNotEmpty() +fun CharSequence?.isNotNullEmpty(): Boolean = !this.isNullOrBlank() fun String.concatUrl(vararg paths: String): String { val builder = StringBuilder(this.trimEnd('/')) diff --git a/V2rayNG/app/src/main/java/com/v2ray/ang/handler/V2rayConfigManager.kt b/V2rayNG/app/src/main/java/com/v2ray/ang/handler/V2rayConfigManager.kt index c2441964..fec11fca 100644 --- a/V2rayNG/app/src/main/java/com/v2ray/ang/handler/V2rayConfigManager.kt +++ b/V2rayNG/app/src/main/java/com/v2ray/ang/handler/V2rayConfigManager.kt @@ -1227,7 +1227,11 @@ object V2rayConfigManager { if (profileItem.portHopping.isNotNullEmpty()) { hysteriaSetting.udphop = StreamSettingsBean.HysteriaSettingsBean.HysteriaUdpHopBean( port = profileItem.portHopping, - interval = profileItem.portHoppingInterval?.ifEmpty { "30" }.orEmpty().toInt() + interval = profileItem.portHoppingInterval + ?.trim() + ?.toIntOrNull() + ?.takeIf { it >= 5 } + ?: 30 ) } streamSettings.hysteriaSettings = hysteriaSetting