Return if there are no rows to save 08/238508/1
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Tue, 14 Jul 2020 14:35:48 +0000 (16:35 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Tue, 14 Jul 2020 14:39:00 +0000 (16:39 +0200)
Before this change, an attempt to save an empty list of objects would populate
the NAME and PERMISSIONS table but insert no objects into the OBJECTS table.

Change-Id: I08a2b68831ed51564e43ef4a01fca28d2c789641

src/manager/service/db-crypto.cpp

index 23b7d1d..c115d05 100644 (file)
@@ -393,6 +393,9 @@ bool Crypto::isNameOwnerPresent(const Name &name, const ClientId &owner) const
 void Crypto::saveRows(const Name &name, const ClientId &owner,
                                          const RowVector &rows)
 {
+       if (rows.empty())
+               return;
+
        try {
                // transaction is present in the layer above
                NameTable nameTable(m_connection.get());