fix two compiler warnings
This commit is contained in:
parent
b5078e91c7
commit
5024db6748
2 changed files with 3 additions and 3 deletions
|
@ -43,8 +43,8 @@ class OpenHumansAPI(
|
|||
.toSingle()
|
||||
.map { response ->
|
||||
response.use { _ ->
|
||||
val body = response.body
|
||||
val jsonObject = body?.let { JSONObject(it.string()) }
|
||||
val responseBody = response.body
|
||||
val jsonObject = responseBody?.let { JSONObject(it.string()) }
|
||||
if (!response.isSuccessful) throw OHHttpException(response.code, response.message, jsonObject?.getString("error"))
|
||||
if (jsonObject == null) throw OHHttpException(response.code, response.message, "No body")
|
||||
if (!jsonObject.has("expires_in")) throw OHMissingFieldException("expires_in")
|
||||
|
|
|
@ -564,7 +564,7 @@ class OpenHumansUploader @Inject constructor(
|
|||
creationDate = uploadDate.time
|
||||
),
|
||||
content = bytes,
|
||||
highestQueueId = items.map { it.id }.max()
|
||||
highestQueueId = items.map { it.id }.maxOrNull()
|
||||
))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue