fix for a null pointer exception if clusters are not defined

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3632 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent d4428947af
commit 06b6e35484

@ -118,7 +118,7 @@ public class ViewProfile {
} catch (IOException e) {}
// try to get the profile from remote peer
seed.setAlternativeAddress((String) switchboard.clusterhashes.get(seed.hash));
if (switchboard.clusterhashes != null) seed.setAlternativeAddress((String) switchboard.clusterhashes.get(seed.hash));
profile = yacyClient.getProfile(seed);
// if profile did not arrive, say that peer is disconnected

@ -101,7 +101,7 @@ public final class hello {
}
int urls = -1;
remoteSeed.setAlternativeAddress((String) sb.clusterhashes.get(remoteSeed.hash));
if (sb.clusterhashes != null) remoteSeed.setAlternativeAddress((String) sb.clusterhashes.get(remoteSeed.hash));
// if the remote client has reported its own IP address and the client supports
// the port forwarding feature (if client version >= 0.383) then we try to

@ -2480,7 +2480,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
// if this was performed for a remote crawl request, notify requester
if ((processCase == PROCESSCASE_6_GLOBAL_CRAWLING) && (initiatorPeer != null)) {
log.logInfo("Sending crawl receipt for '" + entry.normalizedURLString() + "' to " + initiatorPeer.getName());
initiatorPeer.setAlternativeAddress((String) clusterhashes.get(initiatorPeer.hash));
if (clusterhashes != null) initiatorPeer.setAlternativeAddress((String) clusterhashes.get(initiatorPeer.hash));
yacyClient.crawlReceipt(initiatorPeer, "crawl", "fill", "indexed", newEntry, "");
}
} else {
@ -2495,7 +2495,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
log.logSevere("Could not index URL " + entry.url() + ": " + ee.getMessage(), ee);
if ((processCase == PROCESSCASE_6_GLOBAL_CRAWLING) && (initiatorPeer != null)) {
initiatorPeer.setAlternativeAddress((String) clusterhashes.get(initiatorPeer.hash));
if (clusterhashes != null) initiatorPeer.setAlternativeAddress((String) clusterhashes.get(initiatorPeer.hash));
yacyClient.crawlReceipt(initiatorPeer, "crawl", "exception", ee.getMessage(), null, "");
}
addURLtoErrorDB(entry.url(), referrerUrlHash, initiatorPeerHash, docDescription, plasmaCrawlEURL.DENIED_UNSPECIFIED_INDEXING_ERROR, new kelondroBitfield());
@ -2508,7 +2508,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
log.logInfo("Not indexed any word in URL " + entry.url() + "; cause: " + noIndexReason);
addURLtoErrorDB(entry.url(), referrerUrlHash, initiatorPeerHash, docDescription, noIndexReason, new kelondroBitfield());
if ((processCase == PROCESSCASE_6_GLOBAL_CRAWLING) && (initiatorPeer != null)) {
initiatorPeer.setAlternativeAddress((String) clusterhashes.get(initiatorPeer.hash));
if (clusterhashes != null) initiatorPeer.setAlternativeAddress((String) clusterhashes.get(initiatorPeer.hash));
yacyClient.crawlReceipt(initiatorPeer, "crawl", "rejected", noIndexReason, null, "");
}
}

@ -222,7 +222,7 @@ public class yacyDHTAction implements yacyPeerAction {
while (i.hasNext()) {
yacySeed seed = seedDB.getConnected((String) i.next());
if (seed == null) continue;
seed.setAlternativeAddress((String) clusterhashes.get(seed.hash));
if (clusterhashes != null) seed.setAlternativeAddress((String) clusterhashes.get(seed.hash));
return seed;
}
return null;

@ -278,7 +278,7 @@ public class yacySearch extends Thread {
// prepare seed targets and threads
final yacySeed targetPeer = yacyCore.seedDB.getConnected(targethash);
if (targetPeer == null) return null;
targetPeer.setAlternativeAddress((String) clusterselection.get(targetPeer.hash));
if (clusterselection != null) targetPeer.setAlternativeAddress((String) clusterselection.get(targetPeer.hash));
yacySearch searchThread = new yacySearch(wordhashes, excludehashes, urlhashes, "", "", 9999, true, 0, targetPeer,
urlManager, wordIndex, containerCache, new TreeMap(), blacklist, snippetCache, timingProfile, rankingProfile, constraint);
searchThread.start();

Loading…
Cancel
Save