diff options
author | Florrie <towerofnix@gmail.com> | 2018-06-03 19:24:21 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-06-03 19:24:21 -0300 |
commit | 4fbcb453bbbc84feabf1ed45c93ead749bf59ef5 (patch) | |
tree | 402374aa6b94ed77014b4f37f16125dac3f44358 | |
parent | e13e4d57302cab12af7e43b431052cc3d2d32e9a (diff) |
Fix shift-up/down crash when not playing anything
-rw-r--r-- | ui.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ui.js b/ui.js index 02c77bb..8e235a0 100644 --- a/ui.js +++ b/ui.js @@ -252,6 +252,10 @@ class AppElement extends FocusElement { } playNextTrack(track) { + if (!track) { + return + } + const queue = this.queueGrouplike let queueIndex = queue.items.indexOf(track) if (queueIndex === -1) { @@ -277,6 +281,10 @@ class AppElement extends FocusElement { } playPreviousTrack(track) { + if (!track) { + return + } + const queue = this.queueGrouplike let queueIndex = queue.items.indexOf(track) if (queueIndex === -1) { |