Skip to content

Commit 302ba27

Browse files
committed
fix copy of copy
1 parent 1f5f3a6 commit 302ba27

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: api/src/Entity/MaterialItem.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,13 @@ public function getCamp(): ?Camp {
150150
public function copyFromPrototype($prototype, $entityMap): void {
151151
$entityMap->add($prototype, $this);
152152

153-
/** @var MaterialList $materialList */
154-
$materialList = $entityMap->get($prototype->materialList);
153+
if (null != $prototype->materialList) {
154+
/** @var MaterialList $materialList */
155+
$materialList = $entityMap->get($prototype->materialList);
155156

156-
if ($entityMap->belongsToTargetCamp($materialList)) {
157-
$materialList->addMaterialItem($this);
157+
if ($entityMap->belongsToTargetCamp($materialList)) {
158+
$materialList->addMaterialItem($this);
159+
}
158160
}
159161

160162
$this->article = $prototype->article;

0 commit comments

Comments
 (0)