From 034303a42d8375bb4fbf9c51e62e204305f6a91a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 10 Nov 2011 12:12:56 -0500 Subject: [PATCH] Adjust NoteIndexList._index in .index() if it falls off the end of the list. --- hooke/playlist.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hooke/playlist.py b/hooke/playlist.py index f323ca2..52d8df1 100644 --- a/hooke/playlist.py +++ b/hooke/playlist.py @@ -88,6 +88,8 @@ class NoteIndexList (list): is `None`. """ if value == None: + if self._index >= len(self): # perhaps items have been popped + self._index = len(self) - 1 return self._index return super(NoteIndexList, self).index(value, *args, **kwargs) -- 2.26.2