diff --git a/packages/cli/src/CredentialsHelper.ts b/packages/cli/src/CredentialsHelper.ts index 6477504b873f4..2400b952c9418 100644 --- a/packages/cli/src/CredentialsHelper.ts +++ b/packages/cli/src/CredentialsHelper.ts @@ -423,7 +423,7 @@ export class CredentialsHelper extends ICredentialsHelper { // eslint-disable-next-line @typescript-eslint/await-thenable const credentials = await this.getCredentials(nodeCredentials, type); - if (Db.collections.Credentials === null) { + if (!Db.isInitialized) { // The first time executeWorkflow gets called the Database has // to get initialized first await Db.init(); diff --git a/packages/cli/src/WebhookServer.ts b/packages/cli/src/WebhookServer.ts index 700cadaa5258a..50c934d968249 100644 --- a/packages/cli/src/WebhookServer.ts +++ b/packages/cli/src/WebhookServer.ts @@ -300,7 +300,7 @@ class App { } this.app.use((req: express.Request, res: express.Response, next: express.NextFunction) => { - if (Db.collections.Workflow === null) { + if (!Db.isInitialized) { const error = new ResponseHelper.ResponseError('Database is not ready!', undefined, 503); return ResponseHelper.sendErrorResponse(res, error); } diff --git a/packages/cli/src/WorkflowExecuteAdditionalData.ts b/packages/cli/src/WorkflowExecuteAdditionalData.ts index 55f52b583bc32..287c362794a4b 100644 --- a/packages/cli/src/WorkflowExecuteAdditionalData.ts +++ b/packages/cli/src/WorkflowExecuteAdditionalData.ts @@ -789,7 +789,7 @@ export async function getWorkflowData( let workflowData: IWorkflowBase | undefined; if (workflowInfo.id !== undefined) { - if (Db.collections.Workflow === null) { + if (!Db.isInitialized) { // The first time executeWorkflow gets called the Database has // to get initialized first await Db.init();