« get me outta code hell

http-music - Command-line music player + utils (not a server!)
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/pickers2.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pickers2.js b/src/pickers2.js
index 53b76a8..81617a9 100644
--- a/src/pickers2.js
+++ b/src/pickers2.js
@@ -27,7 +27,7 @@ class HistoryManager {
 
   addNextTrackToTimeline(picker) {
     const lastTrack = this.timeline[this.timeline.length - 1]
-    this.timeline.push(this.picker(lastTrack))
+    this.timeline.push(this.picker(lastTrack || null))
   }
 
   fillTimeline() {
@@ -68,7 +68,7 @@ const createOrderedPicker = playlist => {
 
   return lastTrack => {
     if (lastTrack === null) {
-      return flattened[0]
+      return flattened.items[0]
     }
 
     const index = flattened.items.indexOf(lastTrack)