Skip to content

Commit

Permalink
Check for publicationType before validating
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrands02 committed Dec 4, 2024
1 parent c9e37b3 commit b1891de
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Service/ValidationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public function __construct(
* Validate a publication to the definition defined in the PublicationType.
*
* @param Publication $publication The publication to validate.
* @return Publication The validated publication.
*
* @return array The validated publication.
*
* @throws DoesNotExistException
* @throws MultipleObjectsReturnedException
Expand All @@ -45,6 +46,10 @@ public function __construct(
*/
public function validatePublication(array $publication): array
{
if (isset($publication['publicationType']) === false) {
return $publication;
}

$publicationTypeId = $publication['publicationType'];
$publicationType = $this->objectService->getObject(objectType: 'publicationType', id: $publicationTypeId);

Expand Down

0 comments on commit b1891de

Please sign in to comment.