« get me outta code hell

don't outright crash if metadata fails to read - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2022-04-13 15:58:04 -0300
committer(quasar) nebula <qznebula@protonmail.com>2022-04-13 15:58:04 -0300
commitd8fbd7f8005cab072d85ff01612e618f986a8ee5 (patch)
tree68daceb71f8e4f1242b9e1e0d73b5c895f9047f3
parent2d9f7ab342403b7f9cf4cf6fbd84bb4c8e9dc731 (diff)
don't outright crash if metadata fails to read
-rw-r--r--metadata-readers.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/metadata-readers.js b/metadata-readers.js
index 64f413a..edcac72 100644
--- a/metadata-readers.js
+++ b/metadata-readers.js
@@ -37,7 +37,11 @@ const metadataReaders = {
       probeDataString += data
     })
 
-    await promisifyProcess(ffprobe, false)
+    try {
+      await promisifyProcess(ffprobe, false)
+    } catch (error) {
+      return null
+    }
 
     let data