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
1 changed files with 1 additions and 1 deletions

View File

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