diff --git a/cmd/contacts.go b/cmd/contacts.go index 756cbd42..1c93367c 100644 --- a/cmd/contacts.go +++ b/cmd/contacts.go @@ -104,6 +104,17 @@ func handleUpdateContact(r *fastglue.Request) error { avatarURL = string(v[0]) } + // Set nulls to empty strings. + if avatarURL == "null" { + avatarURL = "" + } + if phoneNumberCallingCode == "null" { + phoneNumberCallingCode = "" + } + if phoneNumber == "null" { + phoneNumber = "" + } + // Validate mandatory fields. if email == "" { return r.SendErrorEnvelope(fasthttp.StatusBadRequest, app.i18n.Ts("globals.messages.empty", "name", "email"), nil, envelope.InputError)