Skip to content

Commit

Permalink
Merge pull request #844 from bitpredator/dev
Browse files Browse the repository at this point in the history
Fix code scanning alert Unvalidated dynamic method call
  • Loading branch information
bitpredator authored Sep 25, 2024
2 parents 0191c27 + 8a0125f commit ed23114
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server-data/resources/[gameplay]/chat/html/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,12 @@ export default Vue.extend({
'ON_OPEN' | 'ON_SCREEN_STATE_CHANGE' | 'ON_MESSAGE' | 'ON_CLEAR' | 'ON_SUGGESTION_ADD' |
'ON_SUGGESTION_REMOVE' | 'ON_TEMPLATE_ADD' | 'ON_UPDATE_THEMES' | 'ON_MODE_ADD' | 'ON_MODE_REMOVE';

if (this[typeRef]) {
const validMethods = [
'ON_OPEN', 'ON_SCREEN_STATE_CHANGE', 'ON_MESSAGE', 'ON_CLEAR', 'ON_SUGGESTION_ADD',
'ON_SUGGESTION_REMOVE', 'ON_TEMPLATE_ADD', 'ON_UPDATE_THEMES', 'ON_MODE_ADD', 'ON_MODE_REMOVE'
];

if (validMethods.includes(typeRef) && typeof this[typeRef] === 'function') {
this[typeRef](item);
}
};
Expand Down

0 comments on commit ed23114

Please sign in to comment.