Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
skip file validation if path is an empty string and improve error mes…
Browse files Browse the repository at this point in the history
…sage
  • Loading branch information
mirpedrol committed Jul 7, 2023
1 parent 62a283e commit f3a4f3b
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,19 @@ class SchemaValidator extends PluginExtensionPoint {
def Map properties = (Map) group.value['properties']
for (p in properties) {
def String key = (String) p.key
if (params[key] == null) {
if (params[key] == null || params[key] == '') {
continue
}
def Map property = properties[key] as Map
if (property.containsKey('schema')) {
def String schema_name = getSchemaPath(baseDir, property['schema'].toString())
def Path file_path = Nextflow.file(params[key]) as Path
def Path file_path
try {
file_path = Nextflow.file(params[key]) as Path
} catch (IllegalArgumentException e) {
errors << "* --${key}: The file path '${params[key]}' is invalid. Unable to validate file.".toString()
continue
}
log.debug "Starting validation: '$key': '$file_path' with '$schema_name'"
def String fileType = SamplesheetConverter.getFileType(file_path)
def String delimiter = fileType == "csv" ? "," : fileType == "tsv" ? "\t" : null
Expand Down

0 comments on commit f3a4f3b

Please sign in to comment.