diff options
author | Simon McVittie <smcv@debian.org> | 2020-08-30 15:17:33 +0100 |
---|---|---|
committer | Marinus Schraal <mschraal@gnome.org> | 2020-09-01 16:10:37 +0200 |
commit | b6be8e0c17fa9857843c502d412ebcaff398e8ce (patch) | |
tree | 5113dd8b8e119012436d498b7f60450794f45d91 | |
parent | 7abd8ab39ed5ff59011a73bfb32fc7c09a20bce6 (diff) |
scrobbler: Don't crash if gnome-online-accounts is unavailable
goa_client_get_manager() can return NULL (in Python,
GoaClient.get_manager() can return None) if the gnome-online-accounts
D-Bus service is not available.
Resolves: gnome-music#410
Bug-Debian: https://bugs.debian.org/969271
Signed-off-by: Simon McVittie <smcv@debian.org>
-rw-r--r-- | gnomemusic/scrobbler.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gnomemusic/scrobbler.py b/gnomemusic/scrobbler.py index 98bf0ba1..896e1a12 100644 --- a/gnomemusic/scrobbler.py +++ b/gnomemusic/scrobbler.py @@ -77,6 +77,11 @@ class GoaLastFM(GObject.GObject): return manager = self._client.get_manager() + + if manager is None: + self._log.info("GNOME Online Accounts is unavailable") + return + try: manager.call_is_supported_provider( "lastfm", None, self._lastfm_is_supported_cb) |