mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-28 11:58:23 +01:00
Fix wikimode occasionally being null from the API (#1315)
This commit is contained in:
parent
b0f77528e1
commit
a9fc1dacaa
@ -6,6 +6,10 @@ import com.google.gson.annotations.SerializedName;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
public class SubredditSettingData {
|
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
|
// Content visibility || Posts to this profile can appear in r/all and your profile can be discovered in /users
|
||||||
@SerializedName("default_set")
|
@SerializedName("default_set")
|
||||||
private boolean defaultSet;
|
private boolean defaultSet;
|
||||||
@ -246,6 +250,10 @@ public class SubredditSettingData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getWikiMode() {
|
public String getWikiMode() {
|
||||||
|
if (wikiMode == null) {
|
||||||
|
// Default to disabled, since occasionally the API returns null.
|
||||||
|
return WIKIMODE_DISABLED;
|
||||||
|
}
|
||||||
return wikiMode;
|
return wikiMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user