« get me outta code hell

mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ui.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui.js b/ui.js
index 1500ad7..970adbf 100644
--- a/ui.js
+++ b/ui.js
@@ -542,6 +542,11 @@ class AppElement extends FocusElement {
       item = flattenGrouplike(item).items[0]
     }
 
+    // If there is no item (e.g. an empty group), well.. don't do anything.
+    if (!item) {
+      return
+    }
+
     playTrack: {
       // No downloader argument? That's no good - stop here.
       // TODO: An error icon on this item, or something???