File 0001-application-Avoid-CRITICALs-if-a-primary-instance-is.patch of Package gnome-documents.8029
From 9964208e298769a11748f30468d352a6cbb44183 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Thu, 8 Jun 2017 16:10:57 +0200
Subject: [PATCH 01/18] application: Avoid CRITICALs if a primary instance is
 already present
The dbus_unregister method can be invoked more than once. Trying to
unexport an already unexported GDBusInterfaceSkeleton led to:
  GLib-GIO-CRITICAL **:
    g_dbus_interface_skeleton_unexport_from_connection: assertion
    'interface_->priv->connections != NULL' failed
https://bugzilla.gnome.org/show_bug.cgi?id=783548
---
 src/application.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/application.js b/src/application.js
index 4e55bf8..77495de 100644
--- a/src/application.js
+++ b/src/application.js
@@ -453,7 +453,10 @@ const Application = new Lang.Class({
     },
 
     vfunc_dbus_unregister: function(connection, path) {
-        this._searchProvider.unexport(connection);
+        if (this._searchProvider != null) {
+            this._searchProvider.unexport(connection);
+            this._searchProvider = null;
+        }
 
         this.parent(connection, path);
     },
-- 
2.12.3