Fix problem where gatsby would break if document is not in the db.