Skip to content

Commit

Permalink
Avoid TypeError if ClusterState contains no collections, fixes solari…
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner authored Oct 14, 2020
1 parent cd289d4 commit c4bfb65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed
- Tika based file extraction with Solr 8.6
- Avoid TypeError if ClusterState contains no collections

### Changed
- Require specific symfony/event-dispatcher-contracts package instead of the generic symfony/contracts
Expand Down
1 change: 1 addition & 0 deletions src/Core/Client/State/ClusterState.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public function __construct(array $clusterStatus)
$this->clusterStatus = $clusterStatus;

$this->aliases = $clusterStatus[self::ALIASES_PROP] ?? [];
$this->collections = [];
if (isset($clusterStatus[self::COLLECTIONS_NODE])) {
foreach ($clusterStatus[self::COLLECTIONS_NODE] as $collectionName => $collectionState) {
$this->collections[$collectionName] = new CollectionState(
Expand Down

0 comments on commit c4bfb65

Please sign in to comment.