Resolve bug in preset handler if the filepath hasn't been set by setup
This commit is contained in:
@@ -75,6 +75,9 @@ const convertFrequencyToHertz = async (frequency) => {
|
|||||||
* @returns {any} The object containing the different systems the bot is near
|
* @returns {any} The object containing the different systems the bot is near
|
||||||
*/
|
*/
|
||||||
export const getAllPresets = () => {
|
export const getAllPresets = () => {
|
||||||
|
// If the config path hasn't been set by setup
|
||||||
|
if (!configFilePath) return {};
|
||||||
|
|
||||||
const presetDir = resolve(configFilePath);
|
const presetDir = resolve(configFilePath);
|
||||||
console.log(`Getting presets from directory: '${presetDir}'`);
|
console.log(`Getting presets from directory: '${presetDir}'`);
|
||||||
if (existsSync(presetDir)) return JSON.parse(readFileSync(presetDir));
|
if (existsSync(presetDir)) return JSON.parse(readFileSync(presetDir));
|
||||||
|
|||||||
Reference in New Issue
Block a user