* CRM-18543 Deleting email address or phone of CiviMail recipient causes job to hang
* CRM-18543 Deleting email address or phone of CiviMail recipient causes job to hang
$params = array();
$count = 0;
while ($recipients->fetch()) {
+ // CRM-18543: there are situations when both the email and phone are null.
+ // Skip the recipient in this case.
+ if (empty($recipients->email_id) && empty($recipients->phone_id)) {
+ continue;
+ }
+
if ($recipients->phone_id) {
$recipients->email_id = "null";
}