TP-52983 | Girish Suragani | Fixed rt_created_at null crash in Chat s… (#9262)
This commit is contained in:
@@ -39,13 +39,18 @@ object ChatJsonDeserializer : JsonDeserializer<NaviChatWidget> {
|
||||
context: JsonDeserializationContext?,
|
||||
): NaviChatWidget? {
|
||||
json?.let {
|
||||
val rtCreatedAt = it.asJsonObject[NAVI_CHAT_RT_CREATED_AT]
|
||||
var timestamp = Timestamp(0, 0)
|
||||
val jsonObject = it.asJsonObject
|
||||
val timestamp =
|
||||
Timestamp(
|
||||
rtCreatedAt.asJsonObject["seconds"].asLong,
|
||||
rtCreatedAt.asJsonObject["nanos"].asInt
|
||||
)
|
||||
val rtCreatedAt = jsonObject?.get(NAVI_CHAT_RT_CREATED_AT)
|
||||
if (rtCreatedAt?.isJsonObject == true && !rtCreatedAt.isJsonNull) {
|
||||
rtCreatedAt.asJsonObject?.let { rtCreatedAtObject ->
|
||||
val seconds = rtCreatedAtObject.get("seconds")
|
||||
val nanos = rtCreatedAtObject.get("nanos")
|
||||
if (seconds?.isJsonNull == false && nanos?.isJsonNull == false) {
|
||||
timestamp = Timestamp(seconds.asLong, nanos.asInt)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!jsonObject.has(NAVI_CHAT_WIDGET_NAME)) {
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user