by Shawn Peters.
Just came across this exact same error when we tried to delete some old accounts. Were on Moodle 2.8
All our accounts are setup via LDAP sync, but there were and handful of accounts that didn't have an e-mail address setup.
I did an export of the accounts that i needed to delete, added in a bogus email address to them all. Imported users to update the existing accounts and then re-ran the Bulk delete.
Worked like a charm.
Thanks for the help in finding out the issue on this one.
-Shawn