From 7ea052f65472f8614009eb653cfaaaf6eb2390ce Mon Sep 17 00:00:00 2001 From: SquirrelDevelopper Date: Fri, 29 Nov 2024 15:20:05 +0100 Subject: [PATCH] [CHORE] Add type check before calling watchCronDebounced fun to prevent crash --- .../watchers/providers/docker/AbstractDockerListener.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/modules/docker/watchers/providers/docker/AbstractDockerListener.ts b/server/src/modules/docker/watchers/providers/docker/AbstractDockerListener.ts index 8943d9b3..6af35db2 100644 --- a/server/src/modules/docker/watchers/providers/docker/AbstractDockerListener.ts +++ b/server/src/modules/docker/watchers/providers/docker/AbstractDockerListener.ts @@ -73,7 +73,9 @@ export default class DockerListener extends Component perform a watch if (action === 'destroy' || action === 'create') { - await this.watchCronDebounced(); + if (this.watchCronDebounced && typeof this.watchCronDebounced === 'function') { + await this.watchCronDebounced(); + } } else { // Update container state in db if so try {