Handle cases where we could not fetch the thumbnail

This commit is contained in:
vishnukvmd 2024-01-05 11:00:50 +05:30
parent 30904d0d59
commit 51af506f14

View file

@ -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) {