From cd8aacc80887ecd087f5950cadfb75c3d84fa854 Mon Sep 17 00:00:00 2001 From: drpatelh Date: Thu, 3 Dec 2020 17:46:29 +0000 Subject: [PATCH] Fix InvocationTargetException by not using checkIfExists --- modules/local/process/samplesheet_check.nf | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/local/process/samplesheet_check.nf b/modules/local/process/samplesheet_check.nf index 62a204deb..869739afe 100644 --- a/modules/local/process/samplesheet_check.nf +++ b/modules/local/process/samplesheet_check.nf @@ -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 }