Skip to content

Commit 359320d

Browse files
committed
🚑️ Obtain the path thumbnail only when the asset is image or video
1 parent 4733875 commit 359320d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/src/provider/asset_picker_provider.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,10 @@ class DefaultAssetPickerProvider
392392
return null;
393393
}
394394
final AssetEntity asset = assets.single;
395+
// Obtain the thumbnail only when the asset is image or video.
396+
if (asset.type != AssetType.image || asset.type != AssetType.video) {
397+
return null;
398+
}
395399
final Uint8List? assetData = await asset.thumbnailDataWithSize(
396400
pathThumbnailSize,
397401
);

0 commit comments

Comments
 (0)