Skip to content

Commit a072893

Browse files
committed
fix: npe in response
1 parent aadac5e commit a072893

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/kotlin/utils/SynchronousCallAdapterFactory.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ class SynchronousCallAdapterFactory : CallAdapter.Factory() {
1717
if (returnType.toString().contains("retrofit2.Call")) {
1818
return null
1919
}
20-
return object : CallAdapter<Any, Any> {
20+
return object : CallAdapter<Any, Any?> {
2121
override fun responseType(): Type = returnType
22-
override fun adapt(call: retrofit2.Call<Any>): Any {
22+
override fun adapt(call: retrofit2.Call<Any>): Any? {
2323
try {
24-
return call.execute().body()!!
24+
return call.execute().body()
2525
} catch (e: Exception) {
2626
throw RuntimeException(e)
2727
}

0 commit comments

Comments
 (0)