Skip to content

Commit

Permalink
enhanced setUserLimit to reset when passing null to stay consistent w…
Browse files Browse the repository at this point in the history
…ith other methods (#2083)

* added a new check to setUserLimit so it won't silently fail anymore if you put a wrong type in

* adapt spaces idea of converting null to 0

* this way it looks cleaner

* and i need to remove this

* need to do it that way because like Gus said null will not change anyhting

* space prooved me wrong and idk why ist working now
  • Loading branch information
DevYukine authored and iCrawl committed Nov 10, 2017
1 parent 05a41b5 commit 6254490
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/structures/GuildChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class GuildChannel extends Channel {
topic: data.topic,
nsfw: data.nsfw,
bitrate: data.bitrate || (this.bitrate ? this.bitrate * 1000 : undefined),
user_limit: data.userLimit != null ? data.userLimit : this.userLimit, // eslint-disable-line eqeqeq
user_limit: typeof data.userLimit !== 'undefined' ? data.userLimit : this.userLimit,
parent_id: data.parentID,
lock_permissions: data.lockPermissions,
permission_overwrites: data.permissionOverwrites,
Expand Down

0 comments on commit 6254490

Please sign in to comment.