From e3f3156b08116a84a479f990f198051a229f157f Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 13 Mar 2013 16:19:49 +1300 Subject: [PATCH] CRM-12042 edge case protection --- CRM/Core/Payment/BaseIPN.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index 382122ce6d..8ff24fdddb 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -725,6 +725,11 @@ LIMIT 1;"; // we have a pledge now we need to get the oldest unpaid payment $paymentDetails = CRM_Pledge_BAO_PledgePayment::getOldestPledgePayment($pledgeId); + if(empty($paymentDetails['id'])){ + // we can assume this pledge is now completed + // return now so we don't create a core error & roll back + return; + } $paymentDetails['contribution_id'] = $contribution->id; $paymentDetails['status_id'] = $contribution->contribution_status_id; $paymentDetails['actual_amount'] = $contribution->total_amount; -- 2.25.1