mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Fix crash on defaultDomain with invalid UTF-8 strings
This commit is contained in:
parent
23be62bcad
commit
c7e7726bde
1 changed files with 2 additions and 2 deletions
|
|
@ -291,8 +291,8 @@ class CorePreferences {
|
|||
|
||||
private static func safeString(_ raw: String?, defaultValue: String = "") -> String {
|
||||
guard let raw = raw else { return defaultValue }
|
||||
if let data = raw.data(using: .utf8), let s = String(data: data, encoding: .utf8) {
|
||||
return s
|
||||
if let data = raw.data(using: .utf8) {
|
||||
return String(decoding: data, as: UTF8.self)
|
||||
}
|
||||
return defaultValue
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue