Skip to content

Commit

Permalink
Fix sync error when no manufacturers
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-pm committed Apr 19, 2023
1 parent 3c0282b commit 09436bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion zc_plugins/Typesense/v1.0.0/classes/TypesenseZencart.php
Expand Up @@ -745,7 +745,9 @@ protected function indexFullBrandsCollection(string $brandsCollectionName): void
$brandsToImport[] = $brandData;
}

$this->client->collections[$brandsCollectionName]->documents->import($brandsToImport, ['action' => 'upsert']);
if (!empty($brandsToImport)) {
$this->client->collections[$brandsCollectionName]->documents->import($brandsToImport, ['action' => 'upsert']);
}
}

/**
Expand Down

0 comments on commit 09436bf

Please sign in to comment.