Skip to content

Commit

Permalink
CIVIBLD-343 CiviCRM CRM_Financial_BAO_Order/getPriceSetID sometimes r…
Browse files Browse the repository at this point in the history
…eturns NULL and causes CiviCRM to crash
  • Loading branch information
agileware-justin committed Apr 30, 2024
1 parent 959b33d commit e24238d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CRM/Financial/BAO/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,13 @@ public function getPriceSetID(): int {
$this->setPriceSetIDFromSelectedField($fieldID);
}
}

if (!$this->priceSetID) {
$error_msg = 'Failure: Unable to look up Price Set ID for Price Options: ' . json_encode($this->getPriceOptions());
Civi::log()->debug($error_msg);
throw new CRM_Core_Exception($error_msg);
}

return $this->priceSetID;
}

Expand Down

0 comments on commit e24238d

Please sign in to comment.