patch for possible NPE in EcoTable iterator

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4694 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent 9a32a4c328
commit 1cab240198

@ -588,12 +588,16 @@ public class kelondroEcoTable implements kelondroIndex {
public Entry next() {
byte[] k = i.next();
assert k != null;
if (k == null) return null;
try {
this.c = index.geti(k);
} catch (IOException e) {
e.printStackTrace();
return null;
}
assert this.c >= 0;
if (this.c < 0) return null;
byte[] b = new byte[rowdef.objectsize];
if (table == null) {
// read from file
@ -606,6 +610,8 @@ public class kelondroEcoTable implements kelondroIndex {
} else {
// compose from table and key
kelondroRow.Entry v = table.get(this.c);
assert v != null;
if (v == null) return null;
System.arraycopy(k, 0, b, 0, rowdef.primaryKeyLength);
System.arraycopy(v.bytes(), 0, b, rowdef.primaryKeyLength, taildef.objectsize);
}

Loading…
Cancel
Save