From 665e8ec6622377a5ad77e06bf33956f0ece0c0a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Tou=C5=A1ek?= Date: Sun, 26 Apr 2020 11:07:42 +0200 Subject: [PATCH] Fix subscription dropped --- src/Internal/EventStoreConnectionLogicHandler.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Internal/EventStoreConnectionLogicHandler.php b/src/Internal/EventStoreConnectionLogicHandler.php index ed70c841..b5db5a1c 100644 --- a/src/Internal/EventStoreConnectionLogicHandler.php +++ b/src/Internal/EventStoreConnectionLogicHandler.php @@ -657,7 +657,10 @@ private function startSubscription(StartSubscriptionMessage $message): void $message->userCredentials(), fn (EventStoreSubscription $subscription, ResolvedEvent $resolvedEvent): Promise => ($message->eventAppeared())($subscription, $resolvedEvent), function (EventStoreSubscription $subscription, SubscriptionDropReason $reason, ?Throwable $exception = null) use ($message): void { - ($message->subscriptionDropped())($subscription, $reason, $exception); + $subscriptionDroppedHandler = $message->subscriptionDropped(); + if ($subscriptionDroppedHandler !== null) { + $subscriptionDroppedHandler($subscription, $reason, $exception); + } }, $this->settings->verboseLogging(), fn (): ?TcpPackageConnection => $this->connection