From d11b9974783f10bf053c62e1737289b33f08b386 Mon Sep 17 00:00:00 2001 From: Dustin Vietzke Date: Thu, 21 Oct 2021 07:07:27 -0400 Subject: [PATCH] Check if audio files is iterable --- app/data/audio.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/data/audio.js b/app/data/audio.js index 03d9d90..214f29c 100644 --- a/app/data/audio.js +++ b/app/data/audio.js @@ -17,7 +17,9 @@ class Audio extends EventDispatcher { super(); this[props.files] = []; fs.readdir(audioFolder, (err, files) => { - this[props.files].push(...files); + if (files && files.length) { + this[props.files].push(...files); + } }); } /**