Commit 1c6ea1d9 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Fixed nullpointer

parent 33e6ef14
...@@ -61,7 +61,7 @@ trait MultiSampleQScript extends BiopetQScript { ...@@ -61,7 +61,7 @@ trait MultiSampleQScript extends BiopetQScript {
for (sampleID <- getSamples) { for (sampleID <- getSamples) {
currentSample = Some(sampleID) currentSample = Some(sampleID)
samplesOutput += sampleID -> runSingleSampleJobs(sampleID) samplesOutput += sampleID -> runSingleSampleJobs(sampleID)
currentSample = null currentSample = None
} }
} }
...@@ -136,9 +136,15 @@ trait MultiSampleQScript extends BiopetQScript { ...@@ -136,9 +136,15 @@ trait MultiSampleQScript extends BiopetQScript {
} }
override protected[core] def configFullPath: List[String] = { override protected[core] def configFullPath: List[String] = {
(if (currentSample.isDefined) "samples" :: currentSample.get :: Nil else Nil) ::: val s = currentSample match {
(if (currentLibrary.isDefined) "libraries" :: currentLibrary.get :: Nil else Nil) ::: case Some(s) => "samples" :: s :: Nil
super.configFullPath case _ => Nil
}
val l = currentLibrary match {
case Some(l) => "libraries" :: l :: Nil
case _ => Nil
}
s ::: l ::: super.configFullPath
} }
override val config = new ConfigFunctionsExt override val config = new ConfigFunctionsExt
...@@ -151,8 +157,8 @@ trait MultiSampleQScript extends BiopetQScript { ...@@ -151,8 +157,8 @@ trait MultiSampleQScript extends BiopetQScript {
freeVar: Boolean = true, freeVar: Boolean = true,
sample: String = null, sample: String = null,
library: String = null): ConfigValue = { library: String = null): ConfigValue = {
val s = if (sample == null) currentSample.getOrElse(null) else sample val s = currentSample.getOrElse(sample)
val l = if (library == null) currentLibrary.getOrElse(null) else library val l = currentLibrary.getOrElse(library)
super.apply(key, default, submodule, required, freeVar, s, l) super.apply(key, default, submodule, required, freeVar, s, l)
} }
...@@ -161,8 +167,8 @@ trait MultiSampleQScript extends BiopetQScript { ...@@ -161,8 +167,8 @@ trait MultiSampleQScript extends BiopetQScript {
freeVar: Boolean = true, freeVar: Boolean = true,
sample: String = null, sample: String = null,
library: String = null) = { library: String = null) = {
val s = if (sample == null) currentSample.getOrElse(null) else sample val s = currentSample.getOrElse(sample)
val l = if (library == null) currentLibrary.getOrElse(null) else library val l = currentLibrary.getOrElse(library)
super.contains(key, submodule, freeVar, s, l) super.contains(key, submodule, freeVar, s, l)
} }
} }
......
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