firebase-kotlin-sdk icon indicating copy to clipboard operation
firebase-kotlin-sdk copied to clipboard

kotlin.ClassCastException: null cannot be cast to kotlin.collections.Map

Open b95505017 opened this issue 3 years ago • 1 comments
trafficstars

What is the right way to decode DataSnapshot (Firebase realtime database) when the node is empty?

dataSnapshot.value<Foo?>()
dataSnapshot.value(Foo.serializer().nullable)

I expect it will return null, but it throw cast exception instead.

b95505017 avatar Feb 22 '22 21:02 b95505017

They should both work, what platform is this on? can you submit PR with a failing test?

nbransby avatar Apr 06 '22 18:04 nbransby