diff options
author | cmp <camporter1@gmail.com> | 2023-01-24 15:47:28 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-24 15:47:28 +0000 |
commit | a9fc1dacaabfbca89d3a7bed5c49a7f264850d94 (patch) | |
tree | 5bd67cd1b8c790a0a64c78eb93d2170ec37439e2 /app/src | |
parent | b0f77528e15b00025bdb6f52dd34299604e8e19d (diff) | |
download | infinity-for-reddit-a9fc1dacaabfbca89d3a7bed5c49a7f264850d94.tar infinity-for-reddit-a9fc1dacaabfbca89d3a7bed5c49a7f264850d94.tar.gz infinity-for-reddit-a9fc1dacaabfbca89d3a7bed5c49a7f264850d94.tar.bz2 infinity-for-reddit-a9fc1dacaabfbca89d3a7bed5c49a7f264850d94.tar.lz infinity-for-reddit-a9fc1dacaabfbca89d3a7bed5c49a7f264850d94.tar.xz infinity-for-reddit-a9fc1dacaabfbca89d3a7bed5c49a7f264850d94.tar.zst infinity-for-reddit-a9fc1dacaabfbca89d3a7bed5c49a7f264850d94.zip |
Fix wikimode occasionally being null from the API (#1315)
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/subreddit/SubredditSettingData.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/subreddit/SubredditSettingData.java b/app/src/main/java/ml/docilealligator/infinityforreddit/subreddit/SubredditSettingData.java index 4759d102..d718ef08 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/subreddit/SubredditSettingData.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/subreddit/SubredditSettingData.java @@ -6,6 +6,10 @@ import com.google.gson.annotations.SerializedName; import java.util.Objects; public class SubredditSettingData { + public static final String WIKIMODE_ANYONE = "anyone"; + public static final String WIKIMODE_DISABLED = "disabled"; + public static final String WIKIMODE_MODONLY = "modonly"; + // Content visibility || Posts to this profile can appear in r/all and your profile can be discovered in /users @SerializedName("default_set") private boolean defaultSet; @@ -246,6 +250,10 @@ public class SubredditSettingData { } public String getWikiMode() { + if (wikiMode == null) { + // Default to disabled, since occasionally the API returns null. + return WIKIMODE_DISABLED; + } return wikiMode; } |