From 49d91b94c3e299bc8aefde823c5add91af3a22ff Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Tue, 5 Aug 2014 21:31:59 +0200 Subject: [PATCH] npe fix in crawler --- source/net/yacy/crawler/HostBalancer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/net/yacy/crawler/HostBalancer.java b/source/net/yacy/crawler/HostBalancer.java index 0d1d985fc..37117ddb0 100644 --- a/source/net/yacy/crawler/HostBalancer.java +++ b/source/net/yacy/crawler/HostBalancer.java @@ -336,7 +336,7 @@ public class HostBalancer implements Balancer { rhq = this.queues.get(rhh); } // to prevent that the complete roundrobinhosthashes are taken for each round, we remove the entries from the top of the fast queue - List lastEntries = fastTree.lastEntry().getValue(); + List lastEntries = fastTree.size() > 0 ? fastTree.lastEntry().getValue() : null; if (lastEntries != null) { for (String h: lastEntries) this.roundRobinHostHashes.remove(h); }