fix for Nullpointer Exception when adding a bookmark

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1256 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
allo 2005-12-27 13:03:13 +00:00
parent 09c95544c0
commit 2982715a04

View File

@ -303,7 +303,11 @@ public class bookmarksDB {
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)