Skip to content

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

fix for http://www.yacy-forum.de/viewtopic.php?p=36587#36587

orbiterd7de0938a64a
diff --git a/source/de/anomic/plasma/plasmaWebStructure.java b/source/de/anomic/plasma/plasmaWebStructure.java
index e6c502fd8..429c4fed6 100644
--- a/source/de/anomic/plasma/plasmaWebStructure.java
+++ b/source/de/anomic/plasma/plasmaWebStructure.java
@@ -236,12 +236,16 @@ public class plasmaWebStructure {
public int referencesCount(String domhash) {
// returns the number of domains that are referenced by this domhash
assert domhash.length() == 6 : "domhash = " + domhash;
- SortedMap tailMap = structure.tailMap(domhash);
- if ((tailMap == null) || (tailMap.size() == 0)) return 0;
- String key = (String) tailMap.firstKey();
- if (key.startsWith(domhash)) {
- return refstr2count((String) tailMap.get(key));
- } else {
+ try {
+ SortedMap tailMap = structure.tailMap(domhash);
+ if ((tailMap == null) || (tailMap.size() == 0)) return 0;
+ String key = (String) tailMap.firstKey();
+ if (key.startsWith(domhash)) {
+ return refstr2count((String) tailMap.get(key));
+ } else {
+ return 0;
+ }
+ } catch (ConcurrentModificationException e) {
return 0;
}
}