Skip to content
This repository has been archived by the owner on Mar 29, 2021. It is now read-only.

Commit

Permalink
adds a check on properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Idrinth committed Oct 9, 2016
1 parent 6f9f076 commit 316c552
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/mods/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,16 @@ idrinth.chat = {
}
];
for (var chatId in idrinth.chat.chatRank) {
var intChatId = parseInt ( chatId, 10 );
if ( document.getElementById ( 'idrinth-chat-tab-click-' + chatId ) && intChatId !== chat && intChatId > 1 && !( user in idrinth.chat.chatRank[chatId] ) ) {
promotionModes.push ( {
chat: chatId,
label: 'Invite to Chat ' + document.getElementById ( 'idrinth-chat-tab-click-' + chatId ).innerHTML,
rank: 'User',
requiredRank: 1
} );
if ( idrinth.chat.chatRank.hasOwnProperty ( chatId ) ) {
var intChatId = parseInt ( chatId, 10 );
if ( document.getElementById ( 'idrinth-chat-tab-click-' + chatId ) && intChatId !== chat && intChatId > 1 && !( user in idrinth.chat.chatRank[chatId] ) ) {
promotionModes.push ( {
chat: chatId,
label: 'Invite to Chat ' + document.getElementById ( 'idrinth-chat-tab-click-' + chatId ).innerHTML,
rank: 'User',
requiredRank: 1
} );
}
}
}
return promotionModes;
Expand Down

0 comments on commit 316c552

Please sign in to comment.