diff options
author | Daniel Gultsch <inputmice@siacs.eu> | 2015-01-12 18:40:15 +0100 |
---|---|---|
committer | Daniel Gultsch <inputmice@siacs.eu> | 2015-01-12 18:40:15 +0100 |
commit | dd5101ff5c46034a7c5ddf04b16a5aa8f0dc5f48 (patch) | |
tree | 9c887cecd6cc4bb0dc78003d569e617e04cd512c /src/main/java/eu/siacs | |
parent | 8d3323e384746acfad563d9389529b0802787261 (diff) |
catch bug in guessContentType
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r-- | src/main/java/eu/siacs/conversations/utils/UIHelper.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java index 23fc48bb..ed1db287 100644 --- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java @@ -171,7 +171,12 @@ public class UIHelper { if (path == null) { return ""; } - final String mime = URLConnection.guessContentTypeFromName(path); + final String mime; + try { + mime = URLConnection.guessContentTypeFromName(path); + } catch (final StringIndexOutOfBoundsException ignored) { + return ""; + } if (mime == null) { return ""; } else if (mime.startsWith("audio/")) { |