Fixes npe and return type of auth.run()
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / mkjsf / pazpar2 / commands / InitCommand.java
index 890e4ab..632e139 100644 (file)
@@ -75,7 +75,7 @@ public class InitCommand extends Pazpar2Command implements ServiceProxyCommand {
       newCommand.setParameterInState(parameters.get(parameterName).copy());      \r
     }\r
     newCommand.spCommand = new InitCommandSp(this);\r
-    if (spCommand.getUploadedInitDoc()!=null) {\r
+    if (spCommand != null && spCommand.getUploadedInitDoc()!=null) {\r
       newCommand.spCommand.setUploadedInitDoc(spCommand.getUploadedInitDoc());\r
     }\r
     return newCommand;\r