Skip to content

Commit

Permalink
fix(threads): optString for name field
Browse files Browse the repository at this point in the history
  • Loading branch information
seailz committed Nov 11, 2024
1 parent dec8d1a commit 1382866
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ default JSONObject compile() {
static Thread decompile(@NotNull JSONObject obj, @NotNull DiscordJar discordJar) {
String id = obj.getString("id");
ChannelType type = ChannelType.fromCode(obj.getInt("type"));
String name = obj.getString("name");
String name = obj.optString("name");
Guild guild = obj.has("guild_id") ? discordJar.getGuildById(obj.getString("guild_id")) : null;
int position = obj.has("position") && !obj.isNull("position") ? obj.getInt("position") : 0;
boolean nsfw = obj.has("nsfw") && !obj.isNull("nsfw") && obj.getBoolean("nsfw");
Expand Down

0 comments on commit 1382866

Please sign in to comment.