Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Handle cases where we could not fetch the thumbnail

vishnukvmd51af506f14bb
diff --git a/lib/services/semantic_search/semantic_search_service.dart b/lib/services/semantic_search/semantic_search_service.dart
index 156924f5e1..edc3d6eabe 100644
--- a/lib/services/semantic_search/semantic_search_service.dart
+++ b/lib/services/semantic_search/semantic_search_service.dart
@@ -258,7 +258,12 @@ class SemanticSearchService {
return;
}
try {
- final filePath = (await getThumbnailForUploadedFile(file))!.path;
+ final thumbnail = await getThumbnailForUploadedFile(file);
+ if (thumbnail == null) {
+ _logger.warning("Could not get thumbnail for $file");
+ return;
+ }
+ final filePath = thumbnail.path;
_logger.info("Running clip over $file");
final result = await _mlFramework.getImageEmbedding(filePath);
if (result.length != kEmbeddingLength) {