fixed url parsing

This commit is contained in:
iNPUTmice 2014-10-27 21:47:17 +01:00
parent da822ebae8
commit f45a841caf

View File

@ -383,7 +383,12 @@ public class Message extends AbstractEntity {
return false;
}
String[] pathParts = url.getPath().split("/");
String filename = pathParts[pathParts.length - 1];
String filename;
if (pathParts.length > 0) {
filename = pathParts[pathParts.length - 1];
} else {
filename = pathParts[0];
}
String[] extensionParts = filename.split("\\.");
if (extensionParts.length == 2
&& Arrays.asList(Downloadable.VALID_EXTENSIONS).contains(