Skip to content

Commit

Permalink
chore: Resolve issue passing null to img()
Browse files Browse the repository at this point in the history
  • Loading branch information
hellopablo committed Oct 6, 2023
1 parent 6d35382 commit 86e46e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion admin/controllers/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public function __construct()
$this->aConfig['INDEX_FIELDS']['Value'] = function (\Nails\Cms\Resource\Block $oBlock) use ($oModel) {
switch ($oBlock->type) {
case $oModel::TYPE_IMAGE:
return img(cdnCrop((int) $oBlock->value ?: null, 50, 50));
$sUrl = cdnCrop((int) $oBlock->value ?: null, 50, 50);
return $sUrl ? img($sUrl) : '';
break;

case $oModel::TYPE_FILE:
Expand Down

0 comments on commit 86e46e7

Please sign in to comment.