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
1 changed files with 5 additions and 1 deletions

View File

@ -728,7 +728,11 @@ public class FileBackend {
private Dimensions getVideoDimensions(File file) throws NotAVideoFile {
MediaMetadataRetriever metadataRetriever = new MediaMetadataRetriever();
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();