From 003db4fe894273009245d6ba1ada6bfdfe6e04f6 Mon Sep 17 00:00:00 2001 From: Andrew Bulhak Date: Mon, 25 Nov 2024 18:17:35 +0100 Subject: [PATCH] Adjust port validation to reject port 0 as invalid --- .../Obfuscation/ShadowsocksObfuscationSettingsView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/MullvadVPN/View controllers/Settings/Obfuscation/ShadowsocksObfuscationSettingsView.swift b/ios/MullvadVPN/View controllers/Settings/Obfuscation/ShadowsocksObfuscationSettingsView.swift index f52452e7a660..9e5b2b293693 100644 --- a/ios/MullvadVPN/View controllers/Settings/Obfuscation/ShadowsocksObfuscationSettingsView.swift +++ b/ios/MullvadVPN/View controllers/Settings/Obfuscation/ShadowsocksObfuscationSettingsView.swift @@ -30,7 +30,7 @@ struct ShadowsocksObfuscationSettingsView: View where VM: ShadowsocksObfusca value: "\(item)", comment: "" ) }, - parseCustomValue: { UInt16($0).map { WireGuardObfuscationShadowsockPort.custom($0) } + parseCustomValue: { UInt16($0).flatMap { $0 > 0 ? WireGuardObfuscationShadowsockPort.custom($0) : nil } }, formatCustomValue: { if case let .custom(port) = $0 {