diff --git a/app/src/main/java/org/libre/agosto/p2play/ajax/Auth.kt b/app/src/main/java/org/libre/agosto/p2play/ajax/Auth.kt index 6383f0d..bba67ec 100644 --- a/app/src/main/java/org/libre/agosto/p2play/ajax/Auth.kt +++ b/app/src/main/java/org/libre/agosto/p2play/ajax/Auth.kt @@ -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,15 +134,20 @@ class Auth: Client() { when(l.toString()){ "followersCount" -> user.followers = data.nextInt() "avatar" -> { - data.beginObject() - while (data.hasNext()){ - val m = data.nextName() - when (m.toString()){ - "path" -> user.avatar = data.nextString() - else -> data.skipValue() + if(data.peek() == JsonToken.BEGIN_OBJECT) { + data.beginObject() + while (data.hasNext()) { + val m = data.nextName() + when (m.toString()) { + "path" -> user.avatar = data.nextString() + else -> data.skipValue() + } } + data.endObject() + } + else{ + data.skipValue() } - data.endObject() } else -> data.skipValue() } diff --git a/build.gradle b/build.gradle index d2e510b..ea5d34b 100644 --- a/build.gradle +++ b/build.gradle @@ -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 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b1a92c3..6d915f0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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