[epiphany/wip/sync] sync-service: Return the default key bundle if the per-collection one is inexistent



commit 41622f9f31cbc772dff6e013ff799e6eaafc9f19
Author: Gabriel Ivascu <ivascu gabriel59 gmail com>
Date:   Thu Mar 16 01:06:04 2017 +0200

    sync-service: Return the default key bundle if the per-collection one is inexistent

 src/sync/ephy-sync-service.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/sync/ephy-sync-service.c b/src/sync/ephy-sync-service.c
index c569c83..0f52daa 100644
--- a/src/sync/ephy-sync-service.c
+++ b/src/sync/ephy-sync-service.c
@@ -796,10 +796,16 @@ SyncCryptoKeyBundle *
 ephy_sync_service_get_key_bundle (EphySyncService *self,
                                   const char      *collection)
 {
+  SyncCryptoKeyBundle *bundle;
+
   g_return_val_if_fail (EPHY_IS_SYNC_SERVICE (self), NULL);
   g_return_val_if_fail (collection, NULL);
 
-  return g_hash_table_lookup (self->key_bundles, collection);
+  bundle = g_hash_table_lookup (self->key_bundles, collection);
+  if (!bundle)
+    bundle = g_hash_table_lookup (self->key_bundles, "default");
+
+  return bundle;
 }
 
 void


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