fixed treatAsDownload() for empty messages

This commit is contained in:
Christian Schneppe 2017-12-16 23:36:07 +01:00
parent 8f0a1c8cd8
commit a5bfc704a3

View file

@ -730,10 +730,14 @@ public class Message extends AbstractEntity {
if (treatAsDownloadable == null) {
try {
final String[] lines = body.split("\n");
if (lines.length == 0) {
treatAsDownloadable = false;
return false;
}
for (String line : lines) {
if (line.contains("\\s+")) {
treatAsDownloadable = false;
return treatAsDownloadable;
return false;
}
}
final URL url = new URL(lines[0]);