Skip to content

Commit 947e467

Browse files
committed
Fix bug when calling get() twice with non existing key
1 parent 6cc102a commit 947e467

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/StaticEntityManager.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ public function __construct($staticEntityClass)
5858
public function get($id, $forceInstance = false)
5959
{
6060
if (array_key_exists($id, $this->instances)) {
61-
return null === $this->instances[$id] ? $this->reflection->newInstance() : $this->instances[$id];
61+
return $this->instances[$id];
6262
} elseif (!$data = $this->getData($id)) {
63-
$this->instances[$id] = null;
6463
return $forceInstance ? $this->reflection->newInstance() : null;
6564
}
6665

0 commit comments

Comments
 (0)