From bd03c6b874d73f5bff28606ab7d0adf21efe47d7 Mon Sep 17 00:00:00 2001 From: theli Date: Sat, 3 Mar 2007 11:56:46 +0000 Subject: [PATCH] *) bugfix in bookmarksDB: - NullpointerException when trying to get an unknown bookmark - bookmarks can either start with http or https git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3427 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/data/bookmarksDB.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/de/anomic/data/bookmarksDB.java b/source/de/anomic/data/bookmarksDB.java index 83aa00f54..d092878f7 100644 --- a/source/de/anomic/data/bookmarksDB.java +++ b/source/de/anomic/data/bookmarksDB.java @@ -322,6 +322,7 @@ public class bookmarksDB { public Bookmark getBookmark(String urlHash){ try { kelondroObjectsMapEntry map = (kelondroObjectsMapEntry)bookmarksTable.get(urlHash); + if (map == null) return null; if (map instanceof Bookmark) return (Bookmark)map; return new Bookmark(map); } catch (IOException e) { @@ -733,7 +734,7 @@ public class bookmarksDB { } public Bookmark(String url){ super(); - if(!url.toLowerCase().startsWith("http://")){ + if(!url.toLowerCase().startsWith("http://") && !url.toLowerCase().startsWith("https://")){ url="http://"+url; } this.urlHash=plasmaURL.urlHash(url);