Skip to content

Commit

Permalink
fix: function invocation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowFactoryTeam committed Sep 8, 2023
1 parent 7cca1b6 commit d05b2a8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,11 @@ function startWebserver() {
// Check if the event has a corresponding plugin
if (eventPlugins[eventName]) {
const pluginFunction = eventPlugins[eventName];
pluginFunction(eventData, projectConfigs, api, defaultBranch, () => {
res.send('Project Create Event handled successfully.');
});

if (typeof pluginFunction === 'function') {
pluginFunction(eventData, projectConfigs, api, defaultBranch, () => {

Check failure

Code scanning / CodeQL

Unvalidated dynamic method call High

Invocation of method with
user-controlled
name may dispatch to unexpected target and cause an exception.
res.send('Project Create Event handled successfully.');
});
}
} else {
console.log(`No plugin found for event: ${eventName}`);
}
Expand Down

0 comments on commit d05b2a8

Please sign in to comment.