aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2022-12-04 08:51:07 +0000
committerDocile-Alligator <25734209+Docile-Alligator@users.noreply.github.com>2022-12-04 08:51:07 +0000
commit282817c1922ac36f9bc25fe82de66606f696579b (patch)
tree33bb05ab417b689e1d63529dec460eaa1c3a0064 /app
parent68ed718aa0bbafe1a1f1352ceb390aeb959fec91 (diff)
downloadinfinity-for-reddit-282817c1922ac36f9bc25fe82de66606f696579b.tar
infinity-for-reddit-282817c1922ac36f9bc25fe82de66606f696579b.tar.gz
infinity-for-reddit-282817c1922ac36f9bc25fe82de66606f696579b.tar.bz2
infinity-for-reddit-282817c1922ac36f9bc25fe82de66606f696579b.tar.lz
infinity-for-reddit-282817c1922ac36f9bc25fe82de66606f696579b.tar.xz
infinity-for-reddit-282817c1922ac36f9bc25fe82de66606f696579b.tar.zst
infinity-for-reddit-282817c1922ac36f9bc25fe82de66606f696579b.zip
Version v5.4.0-beta1. Minor bugs fixed.
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java
index 0683ddb6..e4d12a7f 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java
@@ -50,6 +50,7 @@ class ParseSubscribedThing {
ArrayList<SubscribedUserData> subscribedUserData,
ArrayList<SubredditData> subredditData,
ParseSubscribedSubredditsListener parseSubscribedSubredditsListener) {
+ this.parseSubscribedSubredditsListener = parseSubscribedSubredditsListener;
try {
jsonResponse = new JSONObject(response);
this.accountName = accountName;
@@ -60,16 +61,18 @@ class ParseSubscribedThing {
newSubscribedSubredditData = new ArrayList<>();
newSubscribedUserData = new ArrayList<>();
newSubredditData = new ArrayList<>();
- this.parseSubscribedSubredditsListener = parseSubscribedSubredditsListener;
} catch (JSONException e) {
e.printStackTrace();
- parseSubscribedSubredditsListener.onParseSubscribedSubredditsFail();
}
}
@Override
protected Void doInBackground(Void... voids) {
try {
+ if (jsonResponse == null) {
+ parseFailed = true;
+ return null;
+ }
JSONArray children = jsonResponse.getJSONObject(JSONUtils.DATA_KEY).getJSONArray(JSONUtils.CHILDREN_KEY);
for (int i = 0; i < children.length(); i++) {
JSONObject data = children.getJSONObject(i).getJSONObject(JSONUtils.DATA_KEY);