From f9ecbc447cb3e99f77b5555a2697f94dd90ae2c6 Mon Sep 17 00:00:00 2001 From: Jon Petersson Date: Mon, 29 Apr 2024 13:11:32 +0200 Subject: [PATCH] Trim whitespace from list names on save --- ios/MullvadSettings/CustomListRepository.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ios/MullvadSettings/CustomListRepository.swift b/ios/MullvadSettings/CustomListRepository.swift index 9688618ac822..700a69c446dd 100644 --- a/ios/MullvadSettings/CustomListRepository.swift +++ b/ios/MullvadSettings/CustomListRepository.swift @@ -37,6 +37,9 @@ public struct CustomListRepository: CustomListRepositoryProtocol { public init() {} public func save(list: CustomList) throws { + var list = list + list.name = list.name.trimmingCharacters(in: .whitespaces) + var lists = fetchAll() if let listWithSameName = lists.first(where: { $0.name.compare(list.name) == .orderedSame }),