[gnome-music] artistalbumwidget: Handle discbox is None case
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] artistalbumwidget: Handle discbox is None case
- Date: Tue, 23 Feb 2021 13:06:07 +0000 (UTC)
commit 76b0ff8f7c0b9f7a32c7600f4923aec1dba333db
Author: JamesABaker <baker james jb gmail com>
Date: Wed Jan 6 13:53:13 2021 +0000
artistalbumwidget: Handle discbox is None case
Make sure that the discbox is not None before setting the
show_disc_label property.
This prevents a rare fatal error on launch.
Fixes #430
gnomemusic/widgets/artistalbumwidget.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/widgets/artistalbumwidget.py b/gnomemusic/widgets/artistalbumwidget.py
index 5993e7cb3..8488032d0 100644
--- a/gnomemusic/widgets/artistalbumwidget.py
+++ b/gnomemusic/widgets/artistalbumwidget.py
@@ -107,7 +107,8 @@ class ArtistAlbumWidget(Gtk.Box):
n_items = model.get_n_items()
for i in range(n_items):
discbox = self._disc_list_box.get_row_at_index(i)
- discbox.props.show_disc_label = (n_items > 1)
+ if discbox is not None:
+ discbox.props.show_disc_label = (n_items > 1)
def _song_activated(self, widget, song_widget):
if self.props.selection_mode:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]