diff --git a/backend/src/utils/cluster_processing.py b/backend/src/utils/cluster_processing.py index 59bf8b8..a6ef15b 100644 --- a/backend/src/utils/cluster_processing.py +++ b/backend/src/utils/cluster_processing.py @@ -70,6 +70,10 @@ class ShoppingManager: # First generate the clusters self.generate_clusters() + # Return empty list if no clusters were found + if len(set(self.cluster_labels)) == 0 : + return [] + # Then generate the shopping locations self.generate_shopping_locations()