aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-12-16 23:36:07 +0100
committerChristian Schneppe <christian@pix-art.de>2017-12-16 23:36:07 +0100
commita5bfc704a3f16de4d0c30d5d47cc142bc2924cf0 (patch)
tree01c12954f495a7ada7a931ce50d0a7815804b997 /src/main/java/de
parent8f0a1c8cd8593fa4288e849886aa253dea7e8eb6 (diff)
fixed treatAsDownload() for empty messages
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/pixart/messenger/entities/Message.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Message.java b/src/main/java/de/pixart/messenger/entities/Message.java
index 3277952bb..8c55c57c4 100644
--- a/src/main/java/de/pixart/messenger/entities/Message.java
+++ b/src/main/java/de/pixart/messenger/entities/Message.java
@@ -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]);