[gnome-games] desktop: Catch error in DesktopPlugin.get_uri_sources()
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] desktop: Catch error in DesktopPlugin.get_uri_sources()
- Date: Sat, 6 May 2017 07:58:16 +0000 (UTC)
commit 4d68c988a6e8ac1ad96070e8a66fbb0de660d22b
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sat May 6 09:33:47 2017 +0200
desktop: Catch error in DesktopPlugin.get_uri_sources()
This fixes a compile time error.
https://bugzilla.gnome.org/show_bug.cgi?id=781334
plugins/desktop/src/desktop-plugin.vala | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/plugins/desktop/src/desktop-plugin.vala b/plugins/desktop/src/desktop-plugin.vala
index 8760095..d2282fc 100644
--- a/plugins/desktop/src/desktop-plugin.vala
+++ b/plugins/desktop/src/desktop-plugin.vala
@@ -9,11 +9,18 @@ private class Games.DesktopPlugin : Object, Plugin {
public UriSource[] get_uri_sources () {
var query = new DesktopTrackerUriQuery ();
- var connection = Tracker.Sparql.Connection.@get ();
- var uri_source = new TrackerUriSource (connection);
- uri_source.add_query (query);
-
- return { uri_source };
+ try {
+ var connection = Tracker.Sparql.Connection.@get ();
+ var uri_source = new TrackerUriSource (connection);
+ uri_source.add_query (query);
+
+ return { uri_source };
+ }
+ catch (Error e) {
+ debug (e.message);
+
+ return {};
+ }
}
public UriGameFactory[] get_uri_game_factories () {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]