-
Notifications
You must be signed in to change notification settings - Fork 776
Labels
Description
Bug report
The following script:
params {
path: Path? = null
}
workflow {
}
Yields a null pointer error:
java.lang.NullPointerException: null
at java.base/java.util.Objects.requireNonNull(Objects.java:233)
at java.base/java.util.Optional.of(Optional.java:113)
at nextflow.script.ParamsDsl.declare(ParamsDsl.groovy:44)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:343)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1007)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
at Main$_runScript_closure1.doCall(Main)
at Main$_runScript_closure1.doCall(Main)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:280)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1007)
at groovy.lang.Closure.call(Closure.java:433)
at groovy.lang.Closure.call(Closure.java:412)
at nextflow.script.BaseScript.params(BaseScript.groovy:120)
at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
at Main.runScript(Main)
at nextflow.script.BaseScript.run0(BaseScript.groovy:218)
at nextflow.script.BaseScript.run(BaseScript.groovy:260)
at nextflow.script.parser.v2.ScriptLoaderV2.runScript(ScriptLoaderV2.groovy:93)
at nextflow.script.parser.v2.ScriptLoaderV2.runScript(ScriptLoaderV2.groovy)
at nextflow.script.ScriptRunner.run(ScriptRunner.groovy:246)
at nextflow.script.ScriptRunner.execute(ScriptRunner.groovy:139)
at nextflow.cli.CmdRun.run(CmdRun.groovy:429)
at nextflow.cli.Launcher.run(Launcher.groovy:515)
at nextflow.cli.Launcher.main(Launcher.groovy:675)
Removing the null assignment:
params {
path: Path?
}
workflow {
}Yields a false positive error:
$ NXF_SYNTAX_PARSER=v2 nextflow run main.nf
Parameter `path` is required but was not specified on the command line, params file, or configReactions are currently unavailable