Only check fields if the document is a table record

This commit is contained in:
Tobie Morgan Hitchcock 2022-04-13 18:31:28 +01:00
parent cd5ec21164
commit 8e283ecaeb

View file

@ -112,6 +112,8 @@ impl<'a> Document<'a> {
_ => Err(Error::Ignore), _ => Err(Error::Ignore),
}, },
}?; }?;
// Check if this record exists
if self.id.is_some() {
// Loop through all field statements // Loop through all field statements
for fd in self.fd(opt, txn).await?.iter() { for fd in self.fd(opt, txn).await?.iter() {
// Loop over each field in document // Loop over each field in document
@ -135,6 +137,7 @@ impl<'a> Document<'a> {
} }
} }
} }
}
// Output result // Output result
Ok(out) Ok(out)
} }