From 14bc880fa457462776f81cb532c504b80a56560c Mon Sep 17 00:00:00 2001 From: orbiter Date: Tue, 20 Sep 2005 11:20:29 +0000 Subject: [PATCH] fixed bug with crashed profile database git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@753 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- .../de/anomic/plasma/plasmaCrawlProfile.java | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/source/de/anomic/plasma/plasmaCrawlProfile.java b/source/de/anomic/plasma/plasmaCrawlProfile.java index 9d558aaff..f0c41eef3 100644 --- a/source/de/anomic/plasma/plasmaCrawlProfile.java +++ b/source/de/anomic/plasma/plasmaCrawlProfile.java @@ -111,14 +111,28 @@ public class plasmaCrawlProfile { next = null; } public boolean hasNext() { - return handleIterator.hasNext(); + try { + return handleIterator.hasNext(); + } catch (kelondroException e) { + resetDatabase(); + return false; + } } public Object next() { - next = getEntry((String) handleIterator.next()); - return next; + try { + return getEntry((String) handleIterator.next()); + } catch (kelondroException e) { + resetDatabase(); + return null; + } } public void remove() { - removeEntry(next.handle()); + if (next != null) try { + Object handle = next.handle(); + if (handle != null) removeEntry((String) handle); + } catch (kelondroException e) { + resetDatabase(); + } } }