From: Vincent Vanwaelscappel Date: Thu, 17 Nov 2022 08:59:51 +0000 (+0100) Subject: Fix exception when getting conversion url X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d185a85328cf38abdc30dbc868bf272c8ea70f6d;p=cubist_cms-back.git Fix exception when getting conversion url --- diff --git a/src/app/Magic/EntityData.php b/src/app/Magic/EntityData.php index 39c4b69..1e50501 100644 --- a/src/app/Magic/EntityData.php +++ b/src/app/Magic/EntityData.php @@ -106,12 +106,17 @@ class EntityData extends Data } foreach ($media as $m) { - /** @var Media $m */ - $res = $m->getUrl($conversionName); - if (!$res) { - continue; + try { + /** @var Media $m */ + $m->model = $this->getEntity(); + $res = $m->getUrl($conversionName); + if (!$res) { + continue; + } + return $res; + } catch (\Exception $e) { + } - return $res; } return $default;