Skip to content

Commit

Permalink
fix for Nullpointer Exception when adding a bookmark
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1256 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
allo committed Dec 27, 2005
1 parent 09c9554 commit 2982715
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/de/anomic/data/bookmarksDB.java
Expand Up @@ -303,7 +303,11 @@ public Bookmark(String url){
mem.put(BOOKMARK_URL, url);
try {
Map oldmap= bookmarksTable.get(this.urlHash);
mem.put(BOOKMARK_TIMESTAMP, oldmap.get(BOOKMARK_TIMESTAMP)); //preserve timestamp on edit
if(oldmap != null && oldmap.containsKey(BOOKMARK_TIMESTAMP)){
mem.put(BOOKMARK_TIMESTAMP, oldmap.get(BOOKMARK_TIMESTAMP)); //preserve timestamp on edit
}else{
mem.put(BOOKMARK_TIMESTAMP, String.valueOf(System.currentTimeMillis()));
}
removeBookmark(this.urlHash); //prevent empty tags
} catch (IOException e) {
//entry not yet present (normal case)
Expand Down

0 comments on commit 2982715

Please sign in to comment.