only decorate when an event dispatcher was passed

This commit is contained in:
Christian Flothmann 2019-07-03 09:52:02 +02:00
parent 205cd7a0fb
commit f19f28a41d

View File

@ -43,7 +43,7 @@ class Workflow implements WorkflowInterface
{ {
$this->definition = $definition; $this->definition = $definition;
$this->markingStore = $markingStore ?: new MultipleStateMarkingStore(); $this->markingStore = $markingStore ?: new MultipleStateMarkingStore();
$this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher); $this->dispatcher = null !== $dispatcher ? LegacyEventDispatcherProxy::decorate($dispatcher) : null;
$this->name = $name; $this->name = $name;
} }