Skip to content

Commit 4170749

Browse files
committed
Fixed removing file when entity manager is closed
1 parent 93d2c55 commit 4170749

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/EventSubscriber/DeleteFileSourceEventSubscriber.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ public function postFlush(PostFlushEventArgs $args): void
7575
return;
7676
}
7777

78+
if (!$args->getEntityManager()->isOpen()) {
79+
$this->queue = new SplQueue();
80+
81+
return;
82+
}
83+
7884
while (!$this->queue->isEmpty()) {
7985
/** @var \SixtyEightPublishers\FileBundle\Entity\FileInterface $file */
8086
$file = $this->queue->dequeue();

0 commit comments

Comments
 (0)