Skip to content

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

fixes for some changes in SVN 6797 that caused NPEs when the bookmarks initialized

orbiter4917f967294c
diff --git a/source/de/anomic/data/BookmarkDate.java b/source/de/anomic/data/BookmarkDate.java
index 36f13f392..ccd0bb2b7 100644
--- a/source/de/anomic/data/BookmarkDate.java
+++ b/source/de/anomic/data/BookmarkDate.java
@@ -72,6 +72,7 @@ public class BookmarkDate {
int count = 0;
while (it.hasNext()) {
bookmark=it.next();
+ if (bookmark == null) continue;
date = String.valueOf(bookmark.getTimeStamp());
bmDate=getDate(date);
if(bmDate==null){
diff --git a/source/de/anomic/data/bookmarksDB.java b/source/de/anomic/data/bookmarksDB.java
index 16ded41d8..49637dd90 100644
--- a/source/de/anomic/data/bookmarksDB.java
+++ b/source/de/anomic/data/bookmarksDB.java
@@ -102,6 +102,7 @@ public class bookmarksDB {
String[] tagArray;
while(it.hasNext()){
bookmark = it.next();
+ if (bookmark == null) continue;
tagArray = BookmarkHelper.cleanTagsString(bookmark.getTagsString() + bookmark.getFoldersString()).split(",");
tag = null;
for (final String element : tagArray) {
@@ -332,7 +333,7 @@ public class bookmarksDB {
public Bookmark getBookmark(final String urlHash){
try {
final Map<String, String> map = bookmarks.get(urlHash);
- return (map == null) ? new Bookmark(map) : null;
+ return (map == null) ? null : new Bookmark(map);
} catch (final IOException e) {
return null;
}
@@ -373,6 +374,7 @@ public class bookmarksDB {
Bookmark bm;
while(it.hasNext()){
bm=it.next();
+ if (bm == null) continue;
if(priv || bm.getPublic()){
set.add(bm.getUrlHash());
}
@@ -866,17 +868,17 @@ public class bookmarksDB {
try {
return this.bookmarkIter.hasNext();
} catch (final kelondroException e) {
- //resetDatabase();
+ Log.logException(e);
return false;
}
}
public Bookmark next() {
- if (hasNext()) {
+ try {
String s = new String(this.bookmarkIter.next());
return getBookmark(s);
- } else {
- //resetDatabase();
+ } catch (final kelondroException e) {
+ Log.logException(e);
return null;
}
}