Skip to content

Commit

Permalink
Fix an issue in the builder/updater of VoiceChannel.
Browse files Browse the repository at this point in the history
  • Loading branch information
SNWCreations committed Jul 29, 2022
1 parent ba2921d commit 73de5ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public Channel buildChannel(JsonObject object) {
chatLimitTime
);
} else if (type == 2) { // VoiceChannel
boolean hasPassword = object.get("has_password").getAsBoolean();
boolean hasPassword = object.has("has_password") && object.get("has_password").getAsBoolean();
int size = object.get("limit_amount").getAsInt();
return new VoiceChannelImpl(
id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public void updateChannel(JsonObject object, Channel channel) {
int chatLimitTime = object.get("slow_mode").getAsInt();
((TextChannelImpl) channel).setChatLimitTime(chatLimitTime);
} else if (type == 2) { // VoiceChannel
boolean hasPassword = object.get("has_password").getAsBoolean();
boolean hasPassword = object.has("has_password") && object.get("has_password").getAsBoolean();
int size = object.get("limit_amount").getAsInt();
((VoiceChannelImpl) channel).setPasswordProtected(hasPassword);
((VoiceChannelImpl) channel).setMaxSize(size);
Expand Down

0 comments on commit 73de5ef

Please sign in to comment.