aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-07-31 22:31:47 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-07-31 22:31:47 +0200
commit3c48b144483376c266dd323c179e92ec4b118d08 (patch)
treebe42c598f42cf1ad4bb5c4a17221da4b62807f7a /src/main
parent0e96e0a796661aae1af133f24d010a4957f68af2 (diff)
catch exception when trying to get video preview of pgp encrypted file
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/eu/siacs/conversations/persistance/FileBackend.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
index 947e19a6..d4063652 100644
--- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
+++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
@@ -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();