Commit 79a8c186 authored by pjvan_thof's avatar pjvan_thof

Fixing some unsafe code

parent df582f1a
...@@ -284,14 +284,13 @@ object BammetricsReport extends ReportBuilder { ...@@ -284,14 +284,13 @@ object BammetricsReport extends ReportBuilder {
.getOrElse(throw new IllegalStateException("Sample must be there")) .getOrElse(throw new IllegalStateException("Sample must be there"))
val libraryName = val libraryName =
library.flatMap(l => Await.result(summary.getLibraryName(l), Duration.Inf)) library.flatMap(l => Await.result(summary.getLibraryName(l), Duration.Inf))
if (yKeyList.find(x => map.contains(x) && map(x).isDefined).isEmpty) { val yKey = yKeyList.find(x => map.contains(x) && map(x).isDefined).getOrElse("none")
"" val xKey = xKeyList.find(x => map.contains(x) && map(x).isDefined).getOrElse("none")
}
val yKey = yKeyList.find(x => map.contains(x) && map(x).isDefined).get
val xKey = xKeyList.find(x => map.contains(x) && map(x).isDefined).get
Map( Map(
yKeyList.head -> map(yKey).getOrElse(Array()), yKeyList.head -> map.getOrElse(yKey, None).getOrElse(Array()),
(sampleName + libraryName.map("-" + _).getOrElse("")) -> map(xKey).getOrElse(Array()) (sampleName + libraryName.map("-" + _).getOrElse("")) -> map
.getOrElse(xKey, None)
.getOrElse(Array())
) )
}.toArray }.toArray
......
Markdown is supported
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