Skip to content

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

fix for NPE if surrogates do not exist

orbitercd197bb555af
diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java
index 0eff8cc9c..16ca11ada 100644
--- a/source/net/yacy/search/Switchboard.java
+++ b/source/net/yacy/search/Switchboard.java
@@ -1973,7 +1973,7 @@ public final class Switchboard extends serverSwitch {
try {
// check surrogates
final String[] surrogatelist = this.surrogatesInPath.list();
- if ( surrogatelist.length > 0 ) {
+ if ( surrogatelist != null && surrogatelist.length > 0 ) {
// look if the is any xml inside
for ( final String surrogate : surrogatelist ) {