Skip to content

Commit

Permalink
Adjust port validation to reject port 0 as invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
acb-mv committed Nov 25, 2024
1 parent 1c32466 commit 003db4f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct ShadowsocksObfuscationSettingsView<VM>: 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 {
Expand Down

0 comments on commit 003db4f

Please sign in to comment.