Skip to content

Commit

Permalink
Merge pull request square#3340 from square/zachklipp/awaitresponse-al…
Browse files Browse the repository at this point in the history
…lownulls

Allow awaitResponse() to be called with nullable type parameter.
  • Loading branch information
JakeWharton authored Mar 23, 2020
2 parents 3adf79a + 9106005 commit bfb5cd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion retrofit/src/main/java/retrofit2/KotlinExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ suspend fun <T : Any> Call<T?>.await(): T? {
}
}

suspend fun <T : Any> Call<T>.awaitResponse(): Response<T> {
suspend fun <T> Call<T>.awaitResponse(): Response<T> {
return suspendCancellableCoroutine { continuation ->
continuation.invokeOnCancellation {
cancel()
Expand Down

0 comments on commit bfb5cd3

Please sign in to comment.