[gnome-music] application: Fix crash on opening help



commit ecad5bb877ff5609ad72a3e79fe4f0cbc1363341
Author: Shivansh Handa <avihs 29 gmail com>
Date:   Fri Sep 14 21:31:00 2018 +0530

    application: Fix crash on opening help
    
    Music crashes when accessing help with yelp not installed.
    Catch exception and log warning if help handler is not installed.
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-music/issues/220

 gnomemusic/application.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/application.py b/gnomemusic/application.py
index 436199c4..b0316c00 100644
--- a/gnomemusic/application.py
+++ b/gnomemusic/application.py
@@ -31,6 +31,7 @@
 # delete this exception statement from your version.
 
 from gettext import gettext as _
+import logging
 
 from gi.repository import Gtk, Gio, GLib, Gdk
 
@@ -82,7 +83,10 @@ class Application(Gtk.Application):
 
     @log
     def _help(self, action, param):
-        Gtk.show_uri(None, "help:gnome-music", Gdk.CURRENT_TIME)
+        try:
+            Gtk.show_uri(None, "help:gnome-music", Gdk.CURRENT_TIME)
+        except GLib.Error:
+            logging.warning("Help handler not available.")
 
     @log
     def _about(self, action, param):


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