fixed treatAsDownload() for empty messages
This commit is contained in:
parent
782b8fb744
commit
120ddcf8c9
|
@ -726,10 +726,14 @@ public class Message extends AbstractEntity {
|
||||||
if (treatAsDownloadable == null) {
|
if (treatAsDownloadable == null) {
|
||||||
try {
|
try {
|
||||||
final String[] lines = body.split("\n");
|
final String[] lines = body.split("\n");
|
||||||
|
if (lines.length ==0) {
|
||||||
|
treatAsDownloadable = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
for(String line : lines) {
|
for(String line : lines) {
|
||||||
if (line.contains("\\s+")) {
|
if (line.contains("\\s+")) {
|
||||||
treatAsDownloadable = false;
|
treatAsDownloadable = false;
|
||||||
return treatAsDownloadable;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final URL url = new URL(lines[0]);
|
final URL url = new URL(lines[0]);
|
||||||
|
|
Loading…
Reference in a new issue