mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
Merge pull request #252 from yaredtsy/bugfix/undefined_nodeClass
[server] check `nodeModule.nodeClass` is not undefined before trying to intialize
This commit is contained in:
@@ -19,7 +19,8 @@ export class NodesPool {
|
|||||||
nodeFiles.map(async (file) => {
|
nodeFiles.map(async (file) => {
|
||||||
if (file.endsWith('.js')) {
|
if (file.endsWith('.js')) {
|
||||||
const nodeModule = await require(file)
|
const nodeModule = await require(file)
|
||||||
try {
|
|
||||||
|
if (nodeModule.nodeClass) {
|
||||||
const newNodeInstance = new nodeModule.nodeClass()
|
const newNodeInstance = new nodeModule.nodeClass()
|
||||||
newNodeInstance.filePath = file
|
newNodeInstance.filePath = file
|
||||||
|
|
||||||
@@ -37,8 +38,6 @@ export class NodesPool {
|
|||||||
const nodeIconAbsolutePath = `${filePath.join('/')}/${newNodeInstance.icon}`
|
const nodeIconAbsolutePath = `${filePath.join('/')}/${newNodeInstance.icon}`
|
||||||
this.componentNodes[newNodeInstance.name].icon = nodeIconAbsolutePath
|
this.componentNodes[newNodeInstance.name].icon = nodeIconAbsolutePath
|
||||||
}
|
}
|
||||||
} catch (e) {
|
|
||||||
// console.error(e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user