File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -56,9 +56,11 @@ public function getId(): ?int
5656 /**
5757 * @inheritdoc
5858 */
59- public function getCategoryId (): int
59+ public function getCategoryId (): ? int
6060 {
61- return (int ) $ this ->getData (self ::CATEGORY_ID );
61+ $ categoryId = $ this ->getData (self ::CATEGORY_ID );
62+
63+ return $ categoryId !== null ? (int ) $ categoryId : null ;
6264 }
6365
6466 /**
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ public function execute(AssetInterface $asset): void
7979 $ data = $ this ->objectProcessor ->buildOutputDataArray ($ asset , AssetInterface::class);
8080
8181 $ category = $ asset ->getCategory ();
82- if ($ category !== null ) {
82+ if ($ category-> getId () !== null ) {
8383 $ category = $ this ->categoryRepository ->save ($ category );
8484 }
8585 $ data [self ::CATEGORY_ID ] = $ category ->getId ();
You can’t perform that action at this time.
0 commit comments