Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

bugfix in messages

orbiter07b4e5066bfe
diff --git a/htroot/yacy/message.java b/htroot/yacy/message.java
index 8a3907e77..380d8bfab 100644
--- a/htroot/yacy/message.java
+++ b/htroot/yacy/message.java
@@ -125,11 +125,14 @@ public final class message {
yacySeed otherSeed = yacySeed.genRemoteSeed(otherSeedString, key, true);
String subject = crypt.simpleDecode(post.get("subject", ""), key); // message's subject
- subject = subject.trim();
String message = crypt.simpleDecode(post.get("message", ""), key); // message body
+ if (subject == null || message == null) {
+ prop.putASIS("response", "-1"); // don't accept empty messages
+ return prop;
+ }
message = message.trim();
-
- if (subject.length() == 0 && message.length() == 0) {
+ subject = subject.trim();
+ if (subject.length() == 0 || message.length() == 0) {
prop.putASIS("response", "-1"); // don't accept empty messages
return prop;
}