Contrary to the document and filename terms the xattr terms for a document may be empty (i.e. no DB entry exists), so check for it.
mentioned in commit c1982682