Skip to content

Commit

Permalink
fix: undefined tokens check
Browse files Browse the repository at this point in the history
  • Loading branch information
JsSusenka authored May 30, 2022
1 parent b02edd4 commit 74b26e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/playerController/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ module.exports = class PlayerController {
if (this.config.onJoinCheckBan) {
const ban = hist.find((a) => a.type == 'ban');
if (ban) {
if (ban.tokens.length <= 0 && ban.identifiers.length > 0) {
if (ban.tokens != undefined && ban.tokens.length <= 0 && ban.identifiers !== undefined && ban.identifiers.length > 0) {
await this.db.obj.get('actions').find({ id: ban.id }).assign({tokens: tokens}).value();
this.db.writeFlag(SAVE_PRIORITY_HIGH);
} else if (ban.tokens.length > 0) {
Expand Down

0 comments on commit 74b26e3

Please sign in to comment.