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 2022-02-18 07:06:31 -05:00
parent f3cd177a02
commit 0bd12c8dec
1 changed files with 1 additions and 1 deletions

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: