Skip to content

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

fix for NPE and added comment in search result

orbiter89ae6101b9bb
diff --git a/htroot/js/yacyinteractive.js b/htroot/js/yacyinteractive.js
index 755df524b..14bed7f87 100644
--- a/htroot/js/yacyinteractive.js
+++ b/htroot/js/yacyinteractive.js
@@ -85,7 +85,7 @@ function hideDownloadScript() {
function resultNavigation() {
var html = "";
if (totalResults > 0) {
- html += "<div>" + searchresult.length + " results from a total of " + totalResults + " docs in index; search time: " + ((new Date()).getTime() - start.getTime()) + " milliseconds.&nbsp;";
+ html += "<div>" + searchresult.length + " results from a total of " + totalResults + " docs in index (not showing offline resources); search time: " + ((new Date()).getTime() - start.getTime()) + " milliseconds.&nbsp;";
html += "<div id=\"downloadbutton\" style=\"inline\"></div></div>";
} else {
if (query == "") {
diff --git a/source/de/anomic/search/RankingProcess.java b/source/de/anomic/search/RankingProcess.java
index 97212bfad..bb1064d78 100644
--- a/source/de/anomic/search/RankingProcess.java
+++ b/source/de/anomic/search/RankingProcess.java
@@ -563,8 +563,9 @@ public final class RankingProcess extends Thread {
final Iterator<String> domhashs = this.hostNavigator.keys(false);
URIMetadataRow row;
String domhash, urlhash, hostname;
- while (domhashs.hasNext() && result.size() < 30) {
+ if (this.hostResolver != null) while (domhashs.hasNext() && result.size() < 30) {
domhash = domhashs.next();
+ if (domhash == null) continue;
urlhash = this.hostResolver.get(domhash);
row = urlhash == null ? null : this.query.getSegment().urlMetadata().load(urlhash.getBytes(), null, 0);
hostname = row == null ? null : row.metadata().url().getHost();