android: fix JSON parsing for errors not defined in the UI

This commit is contained in:
Evgeny Poberezkin
2023-03-25 16:27:39 +00:00
parent cea0543e98
commit 15c36c5a84

View File

@@ -2894,7 +2894,7 @@ class APIResponse(val resp: CR, val corr: String? = null) {
val userObject = resp["user_"]?.jsonObject
val user = runCatching<User?> { json.decodeFromJsonElement(userObject!!) }.getOrNull()
return APIResponse(
resp = CR.ChatCmdError(user, ChatError.ChatErrorInvalidJSON(json.encodeToString(resp["chatCmdError"]))),
resp = CR.ChatCmdError(user, ChatError.ChatErrorInvalidJSON(json.encodeToString(resp["chatError"]))),
corr = data["corr"]?.toString()
)
}