[gnome-music/wip/mschraal/albumwidget-corealbum-fix] albumwidget: Crash fix in corealbum setter




commit 18ac2f3dd97f09154ee2d9b5bb19ebcd77d45409
Author: Marinus Schraal <mschraal gnome org>
Date:   Thu Aug 5 17:10:20 2021 +0200

    albumwidget: Crash fix in corealbum setter
    
    self._corealbum might not have been assigned yet. Instead check if
    the signals are connected and that indicates that self._corealbum is
    assigned.

 gnomemusic/widgets/albumwidget.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/widgets/albumwidget.py b/gnomemusic/widgets/albumwidget.py
index 68eccc4cc..b7eb7bdab 100644
--- a/gnomemusic/widgets/albumwidget.py
+++ b/gnomemusic/widgets/albumwidget.py
@@ -102,7 +102,8 @@ class AlbumWidget(Gtk.Box):
 
         :param CoreAlbum corealbum: The CoreAlbum object
         """
-        if self._corealbum:
+        if (self._duration_signal_id != 0
+                or self._model_signal_id != 0):
             self._corealbum.disconnect(self._duration_signal_id)
             self._corealbum.props.model.disconnect(self._model_signal_id)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]