Skip to content
Snippets Groups Projects
Commit bdd9ce38 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Catch NullPointer from queue and convert is to null instead of an failure

parent c6980164
No related branches found
No related tags found
No related merge requests found
......@@ -81,6 +81,12 @@ trait BiopetCommandLineFunction extends CommandLineFunction with Configurable {
/** Set default output file, threads and vmem for current job */
private[core] def internalBeforeGraph(): Unit = {
val firstOutput = try {
this.firstOutput
} catch {
case e:NullPointerException => null
}
if (jobOutputFile == null && firstOutput != null)
jobOutputFile = new File(firstOutput.getAbsoluteFile.getParent, "." + firstOutput.getName + "." + configName + ".out")
......@@ -254,6 +260,10 @@ trait BiopetCommandLineFunction extends CommandLineFunction with Configurable {
def |(that: BiopetCommandLineFunction): BiopetCommandLineFunction = {
this._outputAsStdout = true
that._inputAsStdin = true
this.beforeGraph()
this.internalBeforeGraph()
that.beforeGraph()
that.internalBeforeGraph()
this match {
case p: BiopetPipe => {
p.commands.last._outputAsStdout = true
......@@ -309,6 +319,11 @@ trait BiopetCommandLineFunction extends CommandLineFunction with Configurable {
}
case Right(cmd) => {
cmd._outputAsStdout = true
cmd.beforeGraph()
cmd.internalBeforeGraph()
this.beforeGraph()
this.internalBeforeGraph()
this.threads += cmd.threads
try {
if (cmd.outputs != null) outputFiles ++= cmd.outputs
if (cmd.inputs != null) deps ++= cmd.inputs
......@@ -328,6 +343,11 @@ trait BiopetCommandLineFunction extends CommandLineFunction with Configurable {
}
case Right(cmd) => {
cmd._inputAsStdin = true
cmd.beforeGraph()
cmd.internalBeforeGraph()
this.beforeGraph()
this.internalBeforeGraph()
this.threads += cmd.threads
try {
if (cmd.outputs != null) outputFiles ++= cmd.outputs
if (cmd.inputs != null) deps ++= cmd.inputs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment