fixed treatAsDownload() for empty messages

This commit is contained in:
Daniel Gultsch 2017-12-14 12:25:21 +01:00
parent 782b8fb744
commit 120ddcf8c9
1 changed files with 5 additions and 1 deletions

View File

@ -726,10 +726,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]);