Fix creation of bucket in InMemoryStorageBackend 58/27958/5
authorAleksander Zdyb <a.zdyb@samsung.com>
Tue, 14 Oct 2014 07:59:49 +0000 (09:59 +0200)
committerPawel Wieczorek <p.wieczorek2@samsung.com>
Thu, 16 Oct 2014 14:52:41 +0000 (16:52 +0200)
This prevents creation of bucket without properly
initialized id.

Change-Id: Ib5374e15a0172e48ca5413987df256f19595fe91

src/storage/InMemoryStorageBackend.cpp

index 7365294..ae9c624 100644 (file)
@@ -122,8 +122,7 @@ void InMemoryStorageBackend::insertPolicy(const PolicyBucketId &bucketId, Policy
 
 void InMemoryStorageBackend::createBucket(const PolicyBucketId &bucketId,
                                           const PolicyResult &defaultPolicy) {
-    PolicyBucket newBucket;
-    newBucket.setDefaultPolicy(defaultPolicy);
+    PolicyBucket newBucket(bucketId, defaultPolicy);
     buckets().insert({ bucketId, newBucket });
 }