Skip to content

Commit 89598ba

Browse files
authored
Fixed bug that es version cannot be found when the index is null. (#6389)
1 parent a18768d commit 89598ba

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Engine/ElasticsearchEngine.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ class ElasticsearchEngine extends Engine
4141
*/
4242
public function __construct(protected Client $elastic, ?string $index = null)
4343
{
44-
if ($index) {
45-
$this->index = $this->initIndex($elastic, $index);
46-
}
44+
$this->index = $this->initIndex($elastic, $index);
4745
}
4846

4947
/**
@@ -193,7 +191,7 @@ public function flush(Model $model): void
193191
->unsearchable();
194192
}
195193

196-
protected function initIndex(Client $client, string $index): ?string
194+
protected function initIndex(Client $client, ?string $index): ?string
197195
{
198196
if (! static::$version) {
199197
try {

0 commit comments

Comments
 (0)