From 464d9301733b3e72a79fc53d37c74c0f7dd9efe9 Mon Sep 17 00:00:00 2001 From: Quentin Gabriele Date: Mon, 4 Nov 2024 18:58:52 +0100 Subject: [PATCH] prevent children conversion when parent failed --- src/Models/Media.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Models/Media.php b/src/Models/Media.php index f5d3bc5..1da1d22 100644 --- a/src/Models/Media.php +++ b/src/Models/Media.php @@ -288,6 +288,12 @@ public function executeConversion( if (str_contains($conversion, '.')) { $parent = $this->getOrExecuteConversion(str($conversion)->beforeLast('.')); + /** + * Parent conversion can't be done, so children can't be executed either. + */ + if (! $parent) { + return null; + } } else { $parent = null; }