catch exception when trying to get video preview of pgp encrypted file

This commit is contained in:
Daniel Gultsch 2016-07-31 22:31:47 +02:00
parent 0e96e0a796
commit 3c48b14448

View file

@ -728,7 +728,11 @@ public class FileBackend {
private Dimensions getVideoDimensions(File file) throws NotAVideoFile { private Dimensions getVideoDimensions(File file) throws NotAVideoFile {
MediaMetadataRetriever metadataRetriever = new MediaMetadataRetriever(); MediaMetadataRetriever metadataRetriever = new MediaMetadataRetriever();
try {
metadataRetriever.setDataSource(file.getAbsolutePath()); metadataRetriever.setDataSource(file.getAbsolutePath());
} catch (Exception e) {
throw new NotAVideoFile();
}
String hasVideo = metadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_HAS_VIDEO); String hasVideo = metadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_HAS_VIDEO);
if (hasVideo == null) { if (hasVideo == null) {
throw new NotAVideoFile(); throw new NotAVideoFile();