diff --git a/gtk/gtksearchenginetracker3.c b/gtk/gtksearchenginetracker3.c index 5ecb2ca211..c9c3eebe98 100644 --- a/gtk/gtksearchenginetracker3.c +++ b/gtk/gtksearchenginetracker3.c @@ -97,8 +97,11 @@ finalize (GObject *object) g_clear_object (&engine->search_query); g_clear_object (&engine->search_location_query); - tracker_sparql_connection_close (engine->sparql_conn); - g_clear_object (&engine->sparql_conn); + if (engine->sparql_conn != NULL) + { + tracker_sparql_connection_close (engine->sparql_conn); + g_clear_object (&engine->sparql_conn); + } G_OBJECT_CLASS (gtk_search_engine_tracker3_parent_class)->finalize (object); }