Skip to content

Commit 719b900

Browse files
committed
[Commands] fixed DB injection - followup of #187
1 parent e70c3b7 commit 719b900

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/SegmentAssignment/Indexer/Indexer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public function __construct(string $segmentAssignmentTable, string $segmentAssig
7171
$this->setSegmentAssignmentQueueTable($segmentAssignmentQueueTable);
7272
$this->setStoredFunctions($storedFunctions);
7373
$this->setQueueBuilder($queueBuilder);
74-
$this->setDb(\Pimcore\Db::get());
7574
}
7675

7776
/**
@@ -153,6 +152,9 @@ public function setQueueBuilder(QueueBuilderInterface $queueBuilder) {
153152
*/
154153
public function getDb()
155154
{
155+
if($this->db === null) {
156+
$this->db = \Pimcore\Db::get();
157+
}
156158
return $this->db;
157159
}
158160

0 commit comments

Comments
 (0)