CRM-5039-Testbuild Fixes
[civicrm-core.git] / CRM / Event / Form / Registration / Register.php
index da41970f232744293e6dc666d4306f89d2f87f06..d356cfebbbc5f258f21926f52e2d540d03012a40 100644 (file)
@@ -1091,8 +1091,8 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
         if ($params['tax_amount']) {
           $this->set('tax_amount', $params['tax_amount']);
         }
-        if (!empty($this->get('lineItem')) && is_array($this->get('lineItem'))) {
-          $submittedLineItems = $this->get('lineItem');
+        $submittedLineItems = $this->get('lineItem');
+        if (!empty($submittedLineItems) && is_array($submittedLineItems)) {
           $submittedLineItems[0] = $lineItem;
         }
         else {