Skip to content

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

yacyNews bugfix

orbiter84b74d40f3d8
diff --git a/source/de/anomic/yacy/yacyNewsAction.java b/source/de/anomic/yacy/yacyNewsAction.java
index 4b1817a91..eba34c41b 100644
--- a/source/de/anomic/yacy/yacyNewsAction.java
+++ b/source/de/anomic/yacy/yacyNewsAction.java
@@ -53,8 +53,10 @@ public class yacyNewsAction implements yacyPeerAction {
public void processPeerArrival(yacySeed peer, boolean direct) {
String recordString = peer.get("news", null);
+ System.out.println("### triggered news arrival from peer " + peer.getName() + ", news " + ((recordString == null) ? "empty" : "attached"));
if (recordString == null) return;
yacyNewsRecord record = new yacyNewsRecord(de.anomic.tools.crypt.simpleDecode(recordString, ""));
+ System.out.println("### news arrival from peer " + peer.getName() + ", news=" + record.toString());
try {
this.pool.enqueueGlobalNews(record);
} catch (IOException e) {e.printStackTrace();}
diff --git a/source/de/anomic/yacy/yacyNewsQueue.java b/source/de/anomic/yacy/yacyNewsQueue.java
index 4c39a3440..29ad0100e 100644
--- a/source/de/anomic/yacy/yacyNewsQueue.java
+++ b/source/de/anomic/yacy/yacyNewsQueue.java
@@ -112,8 +112,10 @@ public class yacyNewsQueue {
public synchronized yacyNewsRecord topInc() throws IOException {
if (queueStack.size() == 0) return null;
yacyNewsRecord entry = pop(0);
- entry.incDistribution();
- push(entry);
+ if (entry != null) {
+ entry.incDistribution();
+ push(entry);
+ }
return entry;
}