From ae98fd8a08d2f65415403b3159f3303bdd350978 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Sat, 2 May 2020 08:34:56 +0800 Subject: Fix JSON parsing error when parsing user data. --- .../main/java/ml/docilealligator/infinityforreddit/ParseUserData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseUserData.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseUserData.java index 87334324..f3766d05 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseUserData.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseUserData.java @@ -41,7 +41,7 @@ public class ParseUserData { long cakeday = userDataJson.getLong(JSONUtils.CREATED_UTC_KEY) * 1000; boolean isGold = userDataJson.getBoolean(JSONUtils.IS_GOLD_KEY); boolean isFriend = userDataJson.getBoolean(JSONUtils.IS_FRIEND_KEY); - String description = userDataJson.getString(JSONUtils.PUBLIC_DESCRIPTION_KEY); + String description = userDataJson.getJSONObject(JSONUtils.SUBREDDIT_KEY).getString(JSONUtils.PUBLIC_DESCRIPTION_KEY); return new UserData(userName, iconImageUrl, bannerImageUrl, linkKarma, commentKarma, cakeday, isGold, isFriend, canBeFollowed, description); -- cgit v1.2.3