custom module: prevent error when module.exports is not defined

This commit is contained in:
jean-emmanuel 2022-11-29 07:59:08 +01:00
parent c2e07e6ae0
commit ddcf186a66

View file

@ -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