Skip to content

Commit

Permalink
Fix InvocationTargetException by not using checkIfExists
Browse files Browse the repository at this point in the history
  • Loading branch information
drpatelh committed Dec 3, 2020
1 parent 2268749 commit cd8aacc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions modules/local/process/samplesheet_check.nf
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,16 @@ def get_samplesheet_paths(LinkedHashMap row) {
meta.strandedness = row.strandedness

def array = []
if (!file(row.fastq_1).exists()) {
exit 1, "ERROR: Please check input samplesheet -> Read 1 FastQ file does not exist!\n${row.fastq_1}"
}
if (meta.single_end) {
array = [ meta, [ file(row.fastq_1, checkIfExists: true) ] ]
array = [ meta, [ file(row.fastq_1) ] ]
} else {
array = [ meta, [ file(row.fastq_1, checkIfExists: true), file(row.fastq_2, checkIfExists: true) ] ]
if (!file(row.fastq_2).exists()) {
exit 1, "ERROR: Please check input samplesheet -> Read 2 FastQ file does not exist!\n${row.fastq_2}"
}
array = [ meta, [ file(row.fastq_1), file(row.fastq_2) ] ]
}
return array
}

0 comments on commit cd8aacc

Please sign in to comment.