Hi Guys, please advice. I have a data class with t...
# getting-started
k
Hi Guys, please advice. I have a data class with this property
val bankAccount: BankAccount? = null
When I parse it to DTO object, which takes bankAccount as String, I use
bankAccount.toString()
which, in case of null, ends up being “null” String on DTO object. How should I approach it, so the value is actually null or property is omitted?
j
bankAccount?.toString()
(with safe call operator) would return an actual null value if bankAccount is null itself
k
Thanks!