diff options
author | Eric Wong <e@80x24.org> | 2016-01-05 09:21:05 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-01-05 09:26:28 +0000 |
commit | d5044386bf829125f948b6a706d9c590a60e9791 (patch) | |
tree | 8b867e28f5663fce25502dab62b836683511ae1f /lib/dtas/tracklist.rb | |
parent | 5ed91df8ecc5775ffa1df67f40526a62155f7e7e (diff) | |
download | dtas-d5044386bf829125f948b6a706d9c590a60e9791.tar.gz |
@pos is an array index, and should never go beyond the last element.
Diffstat (limited to 'lib/dtas/tracklist.rb')
-rw-r--r-- | lib/dtas/tracklist.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/dtas/tracklist.rb b/lib/dtas/tracklist.rb index f610449..68e88f2 100644 --- a/lib/dtas/tracklist.rb +++ b/lib/dtas/tracklist.rb @@ -194,9 +194,7 @@ class DTAS::Tracklist # :nodoc: end track = @list.delete_at(idx) len = @list.size - if @pos >= len - @pos = len == 0 ? TL_DEFAULTS["pos"] : len - end + @pos = len - 1 if @pos >= len @goto_pos = @goto_pos = nil # TODO: reposition? track.to_path end |