Skip to content

Commit cde01ef

Browse files
klausinignatov
klausi
authored andcommitted
Issue #2631788 by klausi: Deleting an index should not throw Fatal errors if there is no Elasticsearch connection
1 parent 30749af commit cde01ef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/elasticsearch_connector_search_api/service.inc

+5
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,11 @@ class SearchApiElasticsearchConnector extends SearchApiAbstractService {
373373
$params = $this->getIndexParam($index, TRUE);
374374

375375
try {
376+
// If there is no connection there is nothing we can do.
377+
if (!$this->elasticsearchClient) {
378+
return;
379+
}
380+
376381
$this->elasticsearchClient->indices()->deleteMapping($params);
377382

378383
// Check if there are any other types in the index before deleting it.

0 commit comments

Comments
 (0)