mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-28 21:33:53 +01:00
fixed the null value warning
This commit is contained in:
parent
10c4baf327
commit
50a8dd941c
1 changed files with 3 additions and 1 deletions
|
|
@ -175,7 +175,9 @@ class OkHttpJsonApiClient @Inject constructor(
|
|||
.build()
|
||||
val response: Response = okHttpClient.newCall(request).execute()
|
||||
if (response.body != null && response.isSuccessful) {
|
||||
val json: String = response.body!!.string() ?: return@fromCallable null
|
||||
val json: String? = response.body?.string()
|
||||
if (json.isNullOrEmpty()) {
|
||||
return@fromCallable null }
|
||||
try {
|
||||
return@fromCallable gson.fromJson<UpdateAvatarResponse>(
|
||||
json,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue