From dd5101ff5c46034a7c5ddf04b16a5aa8f0dc5f48 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 12 Jan 2015 18:40:15 +0100 Subject: [PATCH] catch bug in guessContentType --- src/main/java/eu/siacs/conversations/utils/UIHelper.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java index 23fc48bb7..ed1db2875 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/")) {