Skip to content

Commit

Permalink
Fix code scanning alert Unvalidated dynamic method call
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Sep 25, 2024
1 parent 2f0fdeb commit 8a0125f
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 8a0125f

Please sign in to comment.