small bugfixes

This commit is contained in:
lookshe 2016-03-12 15:04:07 +01:00
parent e72f409197
commit 3dc635c6fd
2 changed files with 4 additions and 1 deletions

View file

@ -470,6 +470,9 @@ public class Message extends AbstractEntity {
}
private String extractRelevantExtension(URL url) {
if (url == null) {
return null;
}
String path = url.getPath();
return extractRelevantExtension(path);
}

View file

@ -167,7 +167,7 @@ public class FileUtils {
final int lastDotPosition = filename.lastIndexOf('.');
final int secondToLastDotPosition = filename.lastIndexOf('.', lastDotPosition - 1);
final String secondToLastPart = secondToLastDotPosition != -1 ?
filename.substring(secondToLastDotPosition + 1, lastDotPosition - 1) : "";
filename.substring(secondToLastDotPosition + 1, lastDotPosition) : "";
return secondToLastPart;
}
}