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
|
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.JsonReader
|
||||||
|
import android.util.JsonToken
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import org.libre.agosto.p2play.ManagerSingleton
|
import org.libre.agosto.p2play.ManagerSingleton
|
||||||
import org.libre.agosto.p2play.models.TokenModel
|
import org.libre.agosto.p2play.models.TokenModel
|
||||||
|
@ -133,15 +134,20 @@ class Auth: Client() {
|
||||||
when(l.toString()){
|
when(l.toString()){
|
||||||
"followersCount" -> user.followers = data.nextInt()
|
"followersCount" -> user.followers = data.nextInt()
|
||||||
"avatar" -> {
|
"avatar" -> {
|
||||||
data.beginObject()
|
if(data.peek() == JsonToken.BEGIN_OBJECT) {
|
||||||
while (data.hasNext()){
|
data.beginObject()
|
||||||
val m = data.nextName()
|
while (data.hasNext()) {
|
||||||
when (m.toString()){
|
val m = data.nextName()
|
||||||
"path" -> user.avatar = data.nextString()
|
when (m.toString()) {
|
||||||
else -> data.skipValue()
|
"path" -> user.avatar = data.nextString()
|
||||||
|
else -> data.skipValue()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
data.endObject()
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
data.skipValue()
|
||||||
}
|
}
|
||||||
data.endObject()
|
|
||||||
}
|
}
|
||||||
else -> data.skipValue()
|
else -> data.skipValue()
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ buildscript {
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
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"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// 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
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
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