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
56
56
/**
57
57
* @inheritdoc
58
58
*/
59
- public function getCategoryId (): int
59
+ public function getCategoryId (): ? int
60
60
{
61
- return (int ) $ this ->getData (self ::CATEGORY_ID );
61
+ $ categoryId = $ this ->getData (self ::CATEGORY_ID );
62
+
63
+ return $ categoryId !== null ? (int ) $ categoryId : null ;
62
64
}
63
65
64
66
/**
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ public function execute(AssetInterface $asset): void
79
79
$ data = $ this ->objectProcessor ->buildOutputDataArray ($ asset , AssetInterface::class);
80
80
81
81
$ category = $ asset ->getCategory ();
82
- if ($ category !== null ) {
82
+ if ($ category-> getId () !== null ) {
83
83
$ category = $ this ->categoryRepository ->save ($ category );
84
84
}
85
85
$ data [self ::CATEGORY_ID ] = $ category ->getId ();
You can’t perform that action at this time.
0 commit comments