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

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6800 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent dff660441a
commit 4917f96729

@ -72,6 +72,7 @@ public class BookmarkDate {
int count = 0; int count = 0;
while (it.hasNext()) { while (it.hasNext()) {
bookmark=it.next(); bookmark=it.next();
if (bookmark == null) continue;
date = String.valueOf(bookmark.getTimeStamp()); date = String.valueOf(bookmark.getTimeStamp());
bmDate=getDate(date); bmDate=getDate(date);
if(bmDate==null){ if(bmDate==null){

@ -102,6 +102,7 @@ public class bookmarksDB {
String[] tagArray; String[] tagArray;
while(it.hasNext()){ while(it.hasNext()){
bookmark = it.next(); bookmark = it.next();
if (bookmark == null) continue;
tagArray = BookmarkHelper.cleanTagsString(bookmark.getTagsString() + bookmark.getFoldersString()).split(","); tagArray = BookmarkHelper.cleanTagsString(bookmark.getTagsString() + bookmark.getFoldersString()).split(",");
tag = null; tag = null;
for (final String element : tagArray) { for (final String element : tagArray) {
@ -332,7 +333,7 @@ public class bookmarksDB {
public Bookmark getBookmark(final String urlHash){ public Bookmark getBookmark(final String urlHash){
try { try {
final Map<String, String> map = bookmarks.get(urlHash); 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) { } catch (final IOException e) {
return null; return null;
} }
@ -373,6 +374,7 @@ public class bookmarksDB {
Bookmark bm; Bookmark bm;
while(it.hasNext()){ while(it.hasNext()){
bm=it.next(); bm=it.next();
if (bm == null) continue;
if(priv || bm.getPublic()){ if(priv || bm.getPublic()){
set.add(bm.getUrlHash()); set.add(bm.getUrlHash());
} }
@ -866,17 +868,17 @@ public class bookmarksDB {
try { try {
return this.bookmarkIter.hasNext(); return this.bookmarkIter.hasNext();
} catch (final kelondroException e) { } catch (final kelondroException e) {
//resetDatabase(); Log.logException(e);
return false; return false;
} }
} }
public Bookmark next() { public Bookmark next() {
if (hasNext()) { try {
String s = new String(this.bookmarkIter.next()); String s = new String(this.bookmarkIter.next());
return getBookmark(s); return getBookmark(s);
} else { } catch (final kelondroException e) {
//resetDatabase(); Log.logException(e);
return null; return null;
} }
} }

Loading…
Cancel
Save