[gnome-music/wip/mschraal/type-checking: 1/2] grltrackerwrapper: Check for None on playlist actions




commit 53a420d043a1438d728b75d83353e1c5af3d755b
Author: Marinus Schraal <mschraal gnome org>
Date:   Sat Oct 24 15:32:02 2020 +0200

    grltrackerwrapper: Check for None on playlist actions
    
    In theory it can be None, so the type checker wants this.

 gnomemusic/grilowrappers/grltrackerwrapper.py | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/gnomemusic/grilowrappers/grltrackerwrapper.py b/gnomemusic/grilowrappers/grltrackerwrapper.py
index bf151dc8..d48404a7 100644
--- a/gnomemusic/grilowrappers/grltrackerwrapper.py
+++ b/gnomemusic/grilowrappers/grltrackerwrapper.py
@@ -1219,6 +1219,9 @@ class GrlTrackerWrapper(GObject.GObject):
 
         :param Playlist playlist: playlist
         """
+        if self._tracker_playlists is None:
+            return
+
         self._tracker_playlists.stage_playlist_deletion(playlist)
 
     def finish_playlist_deletion(self, playlist, deleted):
@@ -1227,6 +1230,9 @@ class GrlTrackerWrapper(GObject.GObject):
         :param Playlist playlist: playlist
         :param bool deleted: indicates if the playlist has been deleted
         """
+        if self._tracker_playlists is None:
+            return
+
         self._tracker_playlists.finish_playlist_deletion(playlist, deleted)
 
     def create_playlist(self, playlist_title, callback):
@@ -1235,4 +1241,7 @@ class GrlTrackerWrapper(GObject.GObject):
         :param str playlist_title: playlist title
         :param callback: function to perform once, the playlist is created
         """
+        if self._tracker_playlists is None:
+            return
+
         self._tracker_playlists.create_playlist(playlist_title, callback)


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