Ensure that we do not attempt to add nonexistent attachments (bug 851080)