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 {
MediaMetadataRetriever metadataRetriever = new MediaMetadataRetriever();
metadataRetriever.setDataSource(file.getAbsolutePath());
try {
metadataRetriever.setDataSource(file.getAbsolutePath());
} catch (Exception e) {
throw new NotAVideoFile();
}
String hasVideo = metadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_HAS_VIDEO);
if (hasVideo == null) {
throw new NotAVideoFile();