From ddcf186a66c1ff5c8fae3eafce8bb022b25a4019 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 29 Nov 2022 07:59:08 +0100 Subject: [PATCH] custom module: prevent error when module.exports is not defined --- src/server/custom-module.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/custom-module.js b/src/server/custom-module.js index 737bdc55..d72dbdbe 100644 --- a/src/server/custom-module.js +++ b/src/server/custom-module.js @@ -132,9 +132,11 @@ class CustomModule { return false } - this.init = this.module.exports.init || null - this.oscInFilter = this.module.exports.oscInFilter || null - this.oscOutFilter = this.module.exports.oscOutFilter || null + if (typeof this.module.exports === 'object' && this.module.exports !== null) { + this.init = this.module.exports.init || null + this.oscInFilter = this.module.exports.oscInFilter || null + this.oscOutFilter = this.module.exports.oscOutFilter || null + } return true