diff --git a/src/Adapter/CMS/Page/CommandHandler/EditCmsPageHandler.php b/src/Adapter/CMS/Page/CommandHandler/EditCmsPageHandler.php index d0f822451aacc..3c6e4a5843b1d 100644 --- a/src/Adapter/CMS/Page/CommandHandler/EditCmsPageHandler.php +++ b/src/Adapter/CMS/Page/CommandHandler/EditCmsPageHandler.php @@ -77,12 +77,11 @@ public function handle(EditCmsPageCommand $command) private function createCmsFromCommand(EditCmsPageCommand $command) { $cms = $this->getCmsPageIfExistsById($command->getCmsPageId()->getValue()); - $cmsCategoryId = null !== $command->getCmsPageCategoryId() ? $command->getCmsPageCategoryId()->getValue() : null; - if (null !== $cmsCategoryId) { - $this->assertCmsCategoryExists($cmsCategoryId); + if (null !== $command->getCmsPageCategoryId()) { + $this->assertCmsCategoryExists($command->getCmsPageCategoryId()->getValue()); - $cms->id_cms_category = $cmsCategoryId; + $cms->id_cms_category = $command->getCmsPageCategoryId()->getValue(); } if (null !== $command->getLocalizedTitle()) {