diff --git a/sourcecode/apis/contentauthor/app/Jobs/ReplaceVideoRefId.php b/sourcecode/apis/contentauthor/app/Jobs/ReplaceVideoRefId.php index 7a6d2000b3..2063cb1959 100644 --- a/sourcecode/apis/contentauthor/app/Jobs/ReplaceVideoRefId.php +++ b/sourcecode/apis/contentauthor/app/Jobs/ReplaceVideoRefId.php @@ -71,8 +71,10 @@ private function traverseParameters(Collection $parameters) { /** @var Collection $parameters */ $processedParams = $parameters->map(function ($value) { - if (!empty($value->mime) && $this->videoAdapter->isTargetType($value->mime, $value->path)) { - $value = $this->replaceRef($value); + if (is_object($value) && property_exists($value, 'mime') && property_exists($value, 'path')) { + if (!empty($value->mime) && $this->videoAdapter->isTargetType($value->mime, $value->path)) { + $value = $this->replaceRef($value); + } } if ((bool)(array)$value && (is_array($value) || is_object($value))) { diff --git a/sourcecode/apis/contentauthor/phpstan-baseline.neon b/sourcecode/apis/contentauthor/phpstan-baseline.neon index 04e71b4e2c..1cd11043e6 100644 --- a/sourcecode/apis/contentauthor/phpstan-baseline.neon +++ b/sourcecode/apis/contentauthor/phpstan-baseline.neon @@ -35,11 +35,6 @@ parameters: count: 6 path: app/Http/Controllers/API/QuestionsetController.php - - - message: "#^Access to an undefined property object\\:\\:\\$path\\.$#" - count: 1 - path: app/Jobs/ReplaceVideoRefId.php - - message: "#^Access to an undefined property object\\:\\:\\$tags\\.$#" count: 1