diff --git a/SignalServiceKit/src/Loki/API/Group Chat/LokiGroupChatAPI.swift b/SignalServiceKit/src/Loki/API/Group Chat/LokiGroupChatAPI.swift index 9eeadcfd7..ab83f620b 100644 --- a/SignalServiceKit/src/Loki/API/Group Chat/LokiGroupChatAPI.swift +++ b/SignalServiceKit/src/Loki/API/Group Chat/LokiGroupChatAPI.swift @@ -205,7 +205,7 @@ public final class LokiGroupChatAPI : LokiDotNetAPI { public static func setDisplayName(to newDisplayName: String?, on server: String) -> Promise { print("[Loki] Updating display name on server: \(server).") return getAuthToken(for: server).then { token -> Promise in - let parameters: JSON = [ "name" : newDisplayName ] + let parameters: JSON = [ "name" : (newDisplayName ?? "") ] let url = URL(string: "\(server)/users/me")! let request = TSRequest(url: url, method: "PATCH", parameters: parameters) request.allHTTPHeaderFields = [ "Content-Type" : "application/json", "Authorization" : "Bearer \(token)" ]