From d05b2a88ab27b1b92ac1d52bccbc7a042bfe3f90 Mon Sep 17 00:00:00 2001 From: keiran Date: Fri, 8 Sep 2023 16:06:29 -0500 Subject: [PATCH] fix: function invocation issue --- app.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index 85ddd08..a5d6501 100644 --- a/app.js +++ b/app.js @@ -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, () => { + res.send('Project Create Event handled successfully.'); + }); + } } else { console.log(`No plugin found for event: ${eventName}`); }