mountoperation: Handle D-Bus missing
authorMatthias Clasen <mclasen@redhat.com>
Mon, 30 Dec 2019 20:24:51 +0000 (15:24 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 30 Dec 2019 21:03:47 +0000 (16:03 -0500)
Still not great to make sync calls here, but
at least we should handle failure without criticals.

gtk/gtkmountoperation.c

index b94d12481803b952d73412926659e442c5f31e1b..ebcdba0f2b4d4cb530d35d149a115ffcba015f22 100644 (file)
@@ -202,6 +202,9 @@ gtk_mount_operation_init (GtkMountOperation *operation)
                                                          "org.gtk.MountOperationHandler",
                                                          "/org/gtk/MountOperationHandler",
                                                          NULL, NULL);
+  if (!operation->priv->handler)
+    return;
+
   name_owner = g_dbus_proxy_get_name_owner (G_DBUS_PROXY (operation->priv->handler));
   if (!name_owner)
     g_clear_object (&operation->priv->handler);