Skip to content

Commit 6e0fb96

Browse files
-
1 parent 9a32d6a commit 6e0fb96

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/Manager/ElasticsearchPipelineManager.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ public function getAll(): array
4242
$results = $callResponse->getContent();
4343

4444
$pipelines = [];
45-
foreach ($results as $k => $row) {
46-
$row['name'] = $k;
47-
$pipelineModel = new ElasticsearchPipelineModel();
48-
$pipelineModel->convert($row);
49-
$pipelines[] = $pipelineModel;
45+
if ($results) {
46+
foreach ($results as $k => $row) {
47+
$row['name'] = $k;
48+
$pipelineModel = new ElasticsearchPipelineModel();
49+
$pipelineModel->convert($row);
50+
$pipelines[] = $pipelineModel;
51+
}
52+
usort($pipelines, [$this, 'sortByName']);
5053
}
51-
usort($pipelines, [$this, 'sortByName']);
5254

5355
return $pipelines;
5456
}

0 commit comments

Comments
 (0)