Address some OkHttp nullability issues
This commit is contained in:
@@ -7,8 +7,7 @@ import okhttp3.ResponseBody.Companion.toResponseBody
|
||||
import org.jsoup.nodes.Document
|
||||
|
||||
fun Response.interceptAsHtml(block: (Document) -> Unit): Response {
|
||||
val body = body
|
||||
return if (body?.contentType()?.type == "text" &&
|
||||
return if (body.contentType()?.type == "text" &&
|
||||
body.contentType()?.subtype == "html"
|
||||
) {
|
||||
val bodyString = body.string()
|
||||
|
||||
Reference in New Issue
Block a user