Skip to content

Commit 0ad5e13

Browse files
committed
BUGFIX: Fix error in error handling of cleanup command
If the expected alias was missing, the command would die with Notice: Trying to get property of non-object in NodeIndexCommandController.php line 306
1 parent 2ea9109 commit 0ad5e13

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
@@ -303,7 +303,11 @@ public function cleanupCommand()
303303
}
304304
} catch (ApiException $exception) {
305305
$response = json_decode($exception->getResponse());
306-
$this->logger->log(sprintf('Nothing removed. ElasticSearch responded with status %s, saying "%s: %s"', $response->status, $response->error->type, $response->error->reason));
306+
if ($response->error instanceof \stdClass) {
307+
$this->logger->log(sprintf('Nothing removed. ElasticSearch responded with status %s, saying "%s: %s"', $response->status, $response->error->type, $response->error->reason));
308+
} else {
309+
$this->logger->log(sprintf('Nothing removed. ElasticSearch responded with status %s, saying "%s"', $response->status, $response->error));
310+
}
307311
}
308312
}
309313

0 commit comments

Comments
 (0)