Prevent empty fields from being written to the database.