catch bug in guessContentType

This commit is contained in:
Daniel Gultsch 2015-01-12 18:40:15 +01:00
parent 8d3323e384
commit dd5101ff5c
1 changed files with 6 additions and 1 deletions

View File

@ -171,7 +171,12 @@ public class UIHelper {
if (path == null) { if (path == null) {
return ""; return "";
} }
final String mime = URLConnection.guessContentTypeFromName(path); final String mime;
try {
mime = URLConnection.guessContentTypeFromName(path);
} catch (final StringIndexOutOfBoundsException ignored) {
return "";
}
if (mime == null) { if (mime == null) {
return ""; return "";
} else if (mime.startsWith("audio/")) { } else if (mime.startsWith("audio/")) {