aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorcmp <camporter1@gmail.com>2023-01-24 15:47:28 +0000
committerGitHub <noreply@github.com>2023-01-24 15:47:28 +0000
commita9fc1dacaabfbca89d3a7bed5c49a7f264850d94 (patch)
tree5bd67cd1b8c790a0a64c78eb93d2170ec37439e2 /app/src/main/java
parentb0f77528e15b00025bdb6f52dd34299604e8e19d (diff)
downloadinfinity-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 'app/src/main/java')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/subreddit/SubredditSettingData.java8
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;
}