database: don't allow sync against an empty dict

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan committed 2022-02-22 07:47:38 -05:00
1 parent f3cd177a02
commit 0bd12c8dec
1 file changed
+1 -1
+1 -1
View File
@@ -484,7 +484,7 @@ class MoonrakerDatabase:
value: Mapping[str, DBRecord]
) -> None:
if not value:
return
raise self.server.error("Cannot sync to an empty value")
db = self._get_db(namespace)
new_keys = set(value.keys())
with self.lmdb_env.begin(write=True, buffers=True, db=db) as txn: