Skip to content

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

fix for nullpointer

allo65a8a9fc5862
diff --git a/source/de/anomic/data/bookmarksDB.java b/source/de/anomic/data/bookmarksDB.java
index 11f6b57ed..346af9ab6 100644
--- a/source/de/anomic/data/bookmarksDB.java
+++ b/source/de/anomic/data/bookmarksDB.java
@@ -931,12 +931,8 @@ public class bookmarksDB {
public int compare(Object obj1, Object obj2){
Bookmark bm1=getBookmark((String)obj1);
Bookmark bm2=getBookmark((String)obj2);
- //XXX: what happens, if there is a big difference? (to much for int)
- /*if(this.newestFirst){
- return (new Long(bm2.getTimeStamp() - bm1.getTimeStamp())).intValue();
- }else{
- return (new Long(bm1.getTimeStamp() - bm2.getTimeStamp())).intValue();
- }*/
+ if(bm1==null || bm2==null)
+ return 0; //XXX: i think this should not happen? maybe this needs further tracing of the bug
if(this.newestFirst){
if(bm2.getTimeStamp() - bm1.getTimeStamp() >0)
return 1;