Skip to content
Snippets Groups Projects

fix: wsod on attach shares when not enough shares available at date

Compare and
2 files
+ 4
1
Preferences
File browser
Compare changes
@@ -734,6 +734,9 @@ class ShareTransaction extends ContentEntityBase implements ShareTransactionInte
}
else {
$share_ids = array_values($this->getShareholder()->getCurrentShareIdsAtDate($date));
if (count($share_ids) < abs($this->getQuantity())) {
throw new ShareholderRegisterMissingSharesException();
}
for ($i = 0; $i < abs($this->getQuantity()); $i++) {
$share = Share::load($share_ids[$i]);
$share->get('share_transaction_ids')->appendItem($this->id());