--- src/gui/main.py 2009-07-15 08:21:08.000000000 +0200 +++ src/gui/main.py2 2009-11-21 14:40:20.736483935 +0100 @@ -370,9 +370,11 @@ def playNext(self, widget=None, stop=True): ## Plays the next file in the queue (if it exists). if (self.wTree.get_object("mnuiRandom").get_active()): - # If random is set, pick a random item from the queue. - # -1 because randint includes boundaries. - filename = queue.getTrackRemove(randint(0, queue.length()-1)) + # If queue is empty randint(0,-1) will crash + if queue: + # If random is set, pick a random item from the queue. + # -1 because randint includes boundaries. + filename = queue.getTrackRemove(randint(0, queue.length()-1)) else: # Otherwise just get the next item. filename = queue.getNextTrackRemove()