[gnome-music] player: don't check iter for validness if model can't do that
- From: Vadim Rutkovsky <vrutkovsky src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] player: don't check iter for validness if model can't do that
- Date: Wed, 17 Jun 2015 09:24:45 +0000 (UTC)
commit 02647f22d807a5ddf6071da8926c8d5125515dad
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date: Wed Jun 17 11:23:27 2015 +0200
player: don't check iter for validness if model can't do that
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=749307
gnomemusic/player.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index f56ed5c..6a9f63e 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -371,7 +371,10 @@ class Player(GObject.GObject):
@log
def _get_random_iter(self, currentTrack):
- if not currentTrack or not self.playlist.iter_is_valid(currentTrack):
+ if not currentTrack:
+ return None
+ if hasattr(self.playlist, "iter_is_valid") and\
+ not self.playlist.iter_is_valid(currentTrack):
return None
currentPath = int(self.playlist.get_path(currentTrack).to_string())
rows = self.playlist.iter_n_children(None)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]