From dd5101ff5c46034a7c5ddf04b16a5aa8f0dc5f48 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 12 Jan 2015 18:40:15 +0100 Subject: catch bug in guessContentType --- src/main/java/eu/siacs/conversations/utils/UIHelper.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java/eu') 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/")) { -- cgit v1.2.3