`toModel` was not catching com.squareup.moshi.JsonDataException properly (discovered when joining a Jitsi conf added as a Widget)
This commit is contained in:
parent
33b7294bbf
commit
5d3228d97b
|
@ -53,7 +53,7 @@ inline fun <reified T> Content?.toModel(catchError: Boolean = true): T? {
|
||||||
val moshiAdapter = moshi.adapter(T::class.java)
|
val moshiAdapter = moshi.adapter(T::class.java)
|
||||||
return try {
|
return try {
|
||||||
moshiAdapter.fromJsonValue(this)
|
moshiAdapter.fromJsonValue(this)
|
||||||
} catch (e: Exception) {
|
} catch (e: Throwable) {
|
||||||
if (catchError) {
|
if (catchError) {
|
||||||
Timber.e(e, "To model failed : $e")
|
Timber.e(e, "To model failed : $e")
|
||||||
null
|
null
|
||||||
|
|
Loading…
Reference in New Issue