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



commit 2c91a42aba836a518586a89558bedde95b6bde6b
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]