Solved bug when the account dont have avatar
This commit is contained in:
parent
72d1922d97
commit
cd21704a49
|
@ -1,7 +1,8 @@
|
|||
package org.libre.agosto.p2play.ajax
|
||||
|
||||
import android.support.design.widget.Snackbar
|
||||
// import android.support.design.widget.Snackbar
|
||||
import android.util.JsonReader
|
||||
import android.util.JsonToken
|
||||
import android.util.Log
|
||||
import org.libre.agosto.p2play.ManagerSingleton
|
||||
import org.libre.agosto.p2play.models.TokenModel
|
||||
|
@ -133,16 +134,21 @@ class Auth: Client() {
|
|||
when(l.toString()){
|
||||
"followersCount" -> user.followers = data.nextInt()
|
||||
"avatar" -> {
|
||||
if(data.peek() == JsonToken.BEGIN_OBJECT) {
|
||||
data.beginObject()
|
||||
while (data.hasNext()){
|
||||
while (data.hasNext()) {
|
||||
val m = data.nextName()
|
||||
when (m.toString()){
|
||||
when (m.toString()) {
|
||||
"path" -> user.avatar = data.nextString()
|
||||
else -> data.skipValue()
|
||||
}
|
||||
}
|
||||
data.endObject()
|
||||
}
|
||||
else{
|
||||
data.skipValue()
|
||||
}
|
||||
}
|
||||
else -> data.skipValue()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ buildscript {
|
|||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.1.4'
|
||||
classpath 'com.android.tools.build:gradle:3.2.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#Wed Jul 11 18:31:20 CDT 2018
|
||||
#Sun Sep 30 14:50:40 CDT 2018
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
||||
|
|
Loading…
Reference in New Issue