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