« get me outta code hell

don't explode if grouplike form is empty! - 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>2021-10-10 14:02:59 -0300
committer(quasar) nebula <qznebula@protonmail.com>2021-10-10 14:02:59 -0300
commit8fdf8a581d9362f1a09b2f091aa48748875797f3 (patch)
tree1b25cd927dc84d0196e6150ff04b3b18e56c845e
parentea62f8747d835a27b36f5a19de0ebcf6fce908cd (diff)
don't explode if grouplike form is empty!
-rw-r--r--ui.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/ui.js b/ui.js
index b8dd63c..6d07f2b 100644
--- a/ui.js
+++ b/ui.js
@@ -2842,6 +2842,10 @@ class GrouplikeListingForm extends ListScrollForm {
   }
 
   keyPressed(keyBuf) {
+    if (this.inputs.length === 0) {
+      return
+    }
+
     if (input.isSelectUp(keyBuf)) {
       this.selectUp()
     } else if (input.isSelectDown(keyBuf)) {