The delete function checks existence, so this whole diff block could just be two elgg_delete_admin_notice() calls.