Fixes "null" strings on profile fields.
This commit is contained in:
@@ -465,6 +465,8 @@ class UserMetadata {
|
||||
fun profilePicture(): String? = picture
|
||||
|
||||
fun cleanBlankNames() {
|
||||
if (pronouns == "null") pronouns = null
|
||||
|
||||
if (picture?.isNotEmpty() == true) picture = picture?.trim()
|
||||
if (nip05?.isNotEmpty() == true) nip05 = nip05?.trim()
|
||||
if (displayName?.isNotEmpty() == true) displayName = displayName?.trim()
|
||||
|
||||
@@ -283,7 +283,7 @@ class MetadataEvent(
|
||||
key: String,
|
||||
value: String,
|
||||
) {
|
||||
if (value.isBlank()) {
|
||||
if (value.isBlank() || value == "null") {
|
||||
currentJson.remove(key)
|
||||
} else {
|
||||
currentJson.put(key, value.trim())
|
||||
|
||||
Reference in New Issue
Block a user