TP-76356 | Mehul | gson null handled (#12614)

This commit is contained in:
Mehul Garg
2024-09-18 22:04:17 +05:30
committed by GitHub
parent 72398a068c
commit c983dca9f8

View File

@@ -14,7 +14,7 @@ import com.navi.bbps.feature.customerinput.model.view.BillerAdditionalParamsEnti
fun String.toBillerAdditionalParamsEntityList(): List<BillerAdditionalParamsEntity> {
return try {
val type = object : TypeToken<List<BillerAdditionalParamsEntity>>() {}.type
Gson().fromJson(this, type)
Gson().fromJson(this, type) ?: emptyList()
} catch (e: Exception) {
emptyList()
}