Skip to content

Commit

Permalink
Make sure we get a valid response message back during processing, bef…
Browse files Browse the repository at this point in the history
…ore adding event

Signed-off-by: Diederik de Groot <ddegroot@talon.nl>
  • Loading branch information
dkgroot committed May 9, 2020
1 parent afe87ca commit acbcb8f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/PAMI/Client/Impl/ClientImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public function process()
} elseif ($evePos !== false) {
$event = $this->messageToEvent($aMsg);
$response = $this->findResponse($event);
if ($response === false || $response->isComplete()) {
if (!($response instanceof ResponseMessage) || $response->isComplete()) {
$this->dispatch($event);
} else {
$response->addEvent($event);
Expand All @@ -340,7 +340,9 @@ public function process()
$bMsg .= 'ActionId: ' . $this->lastActionId . "\r\n" . $aMsg;
$event = $this->messageToEvent($bMsg);
$response = $this->findResponse($event);
$response->addEvent($event);
if ($response instanceof ResponseMessage) {
$response->addEvent($event);
}
}
$this->logger->debug('----------------');
}
Expand Down

0 comments on commit acbcb8f

Please sign in to comment.