Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

Fix an NPE when properties are missing.

Andrzej Bialeckid1ae84769cb7
diff --git a/src/plugin/protocol-sftp/src/java/org/apache/nutch/protocol/sftp/Sftp.java b/src/plugin/protocol-sftp/src/java/org/apache/nutch/protocol/sftp/Sftp.java
index 4dfbac8dc..cafc7d50c 100644
--- a/src/plugin/protocol-sftp/src/java/org/apache/nutch/protocol/sftp/Sftp.java
+++ b/src/plugin/protocol-sftp/src/java/org/apache/nutch/protocol/sftp/Sftp.java
@@ -236,6 +236,10 @@ public class Sftp implements Protocol {
user = configuration.get("sftp.user", "anonymous");
password = configuration.get("sftp.password", "guest");
+ if (server == null) {
+ return;
+ }
+
if (channelSftpByHostMap.containsKey(server)) {
return;
}