From e6d26a023f3b16ca44dcdd9b736254a130a8afaf Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Thu, 19 Jan 2012 23:06:09 +0100 Subject: [PATCH] fix for bookmark crash with possible side-effects on crawl start after the crash --- source/de/anomic/data/BookmarksDB.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/source/de/anomic/data/BookmarksDB.java b/source/de/anomic/data/BookmarksDB.java index f4f6ef039..d03603cd7 100644 --- a/source/de/anomic/data/BookmarksDB.java +++ b/source/de/anomic/data/BookmarksDB.java @@ -81,9 +81,14 @@ public class BookmarksDB { Bookmark bookmark; Tag tag; String[] tagArray; - while(it.hasNext()){ - bookmark = it.next(); -// if (bookmark == null) continue; + while (it.hasNext()) { + try { + bookmark = it.next(); + } catch (Throwable e) { + Log.logException(e); + continue; + } + if (bookmark == null) continue; tagArray = BookmarkHelper.cleanTagsString(bookmark.getTagsString() + bookmark.getFoldersString()).split(","); tag = null; for (final String element : tagArray) { @@ -153,6 +158,9 @@ public class BookmarksDB { try { final Map map = this.bookmarks.get(ASCII.getBytes(urlHash)); return (map == null) ? null : new Bookmark(map); + } catch (MalformedURLException e) { + Log.logException(e); + return null; } catch (final IOException e) { Log.logException(e); return null;