From ac16f582aa4ea475183df337102267fe4718a07a Mon Sep 17 00:00:00 2001 From: orbiter Date: Thu, 6 May 2010 22:04:30 +0000 Subject: [PATCH] fix for http://forum.yacy-websuche.de/viewtopic.php?p=20017#p20017 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6858 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/net/yacy/kelondro/table/Table.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/net/yacy/kelondro/table/Table.java b/source/net/yacy/kelondro/table/Table.java index b02d37d06..5a5407085 100644 --- a/source/net/yacy/kelondro/table/Table.java +++ b/source/net/yacy/kelondro/table/Table.java @@ -599,10 +599,14 @@ public class Table implements ObjectIndex, Iterable { table = null; } - file.cleanLast(p, 0); - file.put(i, p, 0); - final Row.Entry lr = rowdef.newEntry(p); - index.put(lr.getPrimaryKeyBytes(), i); + while (file.size() > 0) { + file.cleanLast(p, 0); + final Row.Entry lr = rowdef.newEntry(p); + if (lr == null) continue; // in case that p is not well-formed lr may be null + file.put(i, p, 0); + index.put(lr.getPrimaryKeyBytes(), i); + break; + } } } }