We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f5f3a6 commit 302ba27Copy full SHA for 302ba27
api/src/Entity/MaterialItem.php
@@ -150,11 +150,13 @@ public function getCamp(): ?Camp {
150
public function copyFromPrototype($prototype, $entityMap): void {
151
$entityMap->add($prototype, $this);
152
153
- /** @var MaterialList $materialList */
154
- $materialList = $entityMap->get($prototype->materialList);
+ if (null != $prototype->materialList) {
+ /** @var MaterialList $materialList */
155
+ $materialList = $entityMap->get($prototype->materialList);
156
- if ($entityMap->belongsToTargetCamp($materialList)) {
157
- $materialList->addMaterialItem($this);
+ if ($entityMap->belongsToTargetCamp($materialList)) {
158
+ $materialList->addMaterialItem($this);
159
+ }
160
}
161
162
$this->article = $prototype->article;
0 commit comments