catch bug in guessContentType

This commit is contained in:
Daniel Gultsch 2015-01-12 18:40:15 +01:00
parent 8d3323e384
commit dd5101ff5c

View file

@ -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/")) {