Skip to content

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

Bugfix for / by zero when the AssortmentCluster is empty See: http://www.yacy-forum.de/viewtopic.php?t=2746

hermensf0278b409207
diff --git a/source/de/anomic/plasma/plasmaWordIndexAssortmentCluster.java b/source/de/anomic/plasma/plasmaWordIndexAssortmentCluster.java
index 3750732a6..373b78378 100644
--- a/source/de/anomic/plasma/plasmaWordIndexAssortmentCluster.java
+++ b/source/de/anomic/plasma/plasmaWordIndexAssortmentCluster.java
@@ -359,7 +359,7 @@ public final class plasmaWordIndexAssortmentCluster extends indexAbstractRI impl
c += assortments[j].size() * assortments[j].cacheObjectChunkSize();
k += assortments[j].size();
}
- return (int) (c / k);
+ return (k > 0) ? (int) (c / k) : 0;
}
public int[] cacheNodeStatus() {