diff options
author | scria1000 <91804886+scria1000@users.noreply.github.com> | 2021-12-04 15:23:48 +0000 |
---|---|---|
committer | scria1000 <91804886+scria1000@users.noreply.github.com> | 2021-12-04 15:23:48 +0000 |
commit | 619d6b846a5422298eca016e6e4515737b8bed93 (patch) | |
tree | 4ddc1639b8c74639d825e4316eb6141680b8e42c /app/src/main/java/ml/docilealligator/infinityforreddit | |
parent | 0d80bee501e5feb9e0e1781a61c9bc771189ede4 (diff) | |
download | infinity-for-reddit-619d6b846a5422298eca016e6e4515737b8bed93.tar infinity-for-reddit-619d6b846a5422298eca016e6e4515737b8bed93.tar.gz infinity-for-reddit-619d6b846a5422298eca016e6e4515737b8bed93.tar.bz2 infinity-for-reddit-619d6b846a5422298eca016e6e4515737b8bed93.tar.lz infinity-for-reddit-619d6b846a5422298eca016e6e4515737b8bed93.tar.xz infinity-for-reddit-619d6b846a5422298eca016e6e4515737b8bed93.tar.zst infinity-for-reddit-619d6b846a5422298eca016e6e4515737b8bed93.zip |
Add null check for GALLERY_DATA_KEY
Without this null check, viewing a deleted comment whose OP also had a deleted gallery will cause the Parsing to fail.
Diffstat (limited to 'app/src/main/java/ml/docilealligator/infinityforreddit')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java index 0685170a..834db92f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java @@ -541,7 +541,7 @@ public class ParsePost { } } catch (IllegalArgumentException ignore) { } } else if (post.getPostType() == Post.LINK_TYPE || post.getPostType() == Post.NO_PREVIEW_LINK_TYPE) { - if (data.has(JSONUtils.GALLERY_DATA_KEY)) { + if (!data.isNull(JSONUtils.GALLERY_DATA_KEY)) { JSONArray galleryIdsArray = data.getJSONObject(JSONUtils.GALLERY_DATA_KEY).getJSONArray(JSONUtils.ITEMS_KEY); JSONObject galleryObject = data.getJSONObject(JSONUtils.MEDIA_METADATA_KEY); ArrayList<Post.Gallery> gallery = new ArrayList<>(); |