Fix error when deleting html attachments