We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b353d8 commit 2da8cacCopy full SHA for 2da8cac
firebase-common-internal/src/commonMain/kotlin/dev/gitlive/firebase/internal/decoders.kt
@@ -217,7 +217,12 @@ private fun decodeShort(value: Any?) = when(value) {
217
else -> throw SerializationException("Expected $value to be short")
218
}
219
220
-private fun decodeBoolean(value: Any?) = value as Boolean
+private fun decodeBoolean(value: Any?) = when (value) {
221
+ is Boolean -> value
222
+ is Number -> value.toInt() != 0
223
+ is String -> value.toBoolean()
224
+ else -> throw SerializationException("Expected $value to be boolean")
225
+}
226
227
private fun decodeChar(value: Any?) = when(value) {
228
is Number -> value.toChar()
0 commit comments