Skip to content

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

fix for http://www.yacy-forum.de/viewtopic.php?t=3411

orbiterd03cd4126619
diff --git a/source/de/anomic/kelondro/kelondroFlexTable.java b/source/de/anomic/kelondro/kelondroFlexTable.java
index 6f8021807..da2c6227e 100644
--- a/source/de/anomic/kelondro/kelondroFlexTable.java
+++ b/source/de/anomic/kelondro/kelondroFlexTable.java
@@ -240,7 +240,14 @@ public class kelondroFlexTable extends kelondroFlexWidthArray implements kelondr
}
public Object next() {
- kelondroRow.Entry idxEntry = (kelondroRow.Entry) indexIterator.next();
+ kelondroRow.Entry idxEntry = null;
+ while ((indexIterator.hasNext()) && (idxEntry == null)) {
+ idxEntry = (kelondroRow.Entry) indexIterator.next();
+ }
+ if (idxEntry == null) {
+ serverLog.logSevere("kelondroFlexTable.rowIterator: " + tablename, "indexIterator returned null");
+ return null;
+ }
int idx = (int) idxEntry.getColLong(1);
try {
return get(idx);
diff --git a/source/de/anomic/kelondro/kelondroFlexWidthArray.java b/source/de/anomic/kelondro/kelondroFlexWidthArray.java
index 006b88f8b..904354063 100644
--- a/source/de/anomic/kelondro/kelondroFlexWidthArray.java
+++ b/source/de/anomic/kelondro/kelondroFlexWidthArray.java
@@ -36,9 +36,11 @@ public class kelondroFlexWidthArray implements kelondroArray {
protected kelondroFixedWidthArray[] col;
protected kelondroRow rowdef;
+ protected String tablename;
public kelondroFlexWidthArray(File path, String tablename, kelondroRow rowdef) throws IOException {
this.rowdef = rowdef;
+ this.tablename = tablename;
// initialize columns
col = new kelondroFixedWidthArray[rowdef.columns()];