Skip to content

Commit 216dfe6

Browse files
committed
BUGFIX: Do not fail if response->error is no stdClass
Backported fix from version 4.0
1 parent 4516b32 commit 216dfe6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Classes/Command/NodeIndexCommandController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,11 @@ public function cleanupCommand()
278278
}
279279
} catch (ApiException $exception) {
280280
$response = json_decode($exception->getResponse());
281-
$this->logger->log(sprintf('Nothing removed. ElasticSearch responded with status %s, saying "%s: %s"', $response->status, $response->error->type, $response->error->reason));
281+
if ($response->error instanceof \stdClass) {
282+
$this->logger->log(sprintf('Nothing removed. ElasticSearch responded with status %s, saying "%s: %s"', $response->status, $response->error->type, $response->error->reason));
283+
} else {
284+
$this->logger->log(sprintf('Nothing removed. ElasticSearch responded with status %s, saying "%s"', $response->status, $response->error));
285+
}
282286
}
283287
}
284288

0 commit comments

Comments
 (0)