From a7bdf10ac585f8c9b121bd8c6f2e3eed6b3fd413 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Sat, 30 Jul 2022 18:00:31 +0300 Subject: [PATCH] settings throw errors when missing mandatory properties --- src/structure/interfaces/Setting.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/structure/interfaces/Setting.js b/src/structure/interfaces/Setting.js index 070cc73..6c68b3c 100644 --- a/src/structure/interfaces/Setting.js +++ b/src/structure/interfaces/Setting.js @@ -48,7 +48,10 @@ class Setting extends Component { * @memberof Setting */ constructor(client, options = {}) { - if(!options) return null; + + if (!options) throw new Error(`No options provided to setting`); + if (!options.name) throw new Error(`Setting missing name`); + if (!options.module) throw new Error(`Missing module for ${options.name}`); super(client, { id: options.name,