Skip to content

Commit c8084f6

Browse files
committed
Correct error messages & prevent validation if chars in cell not > 0
1 parent 4b25e04 commit c8084f6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

csv-validator-ui/src/main/scala/uk/gov/nationalarchives/csv/validator/ui/CsvValidatorUi.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ object CsvValidatorUi extends SimpleSwingApplication {
156156
var badLines = 0
157157
var truncated = false
158158

159-
val maxCharsPerCell = convertTextboxValueToInt(potentialMaxCharsPerCell, "errors to display", toConsole)
160-
val maxNumOfLines = convertTextboxValueToInt(potentialMaxNumOfLines, "characters per column", toConsole)
159+
val maxCharsPerCell = convertTextboxValueToInt(potentialMaxCharsPerCell, "characters per column", toConsole)
160+
val maxNumOfLines = convertTextboxValueToInt(potentialMaxNumOfLines, "errors to display", toConsole)
161161

162-
val safeToRunValidation = csvFilePath.nonEmpty && csvSchemaFilePath.nonEmpty && maxNumOfLines > 0
162+
val safeToRunValidation = csvFilePath.nonEmpty && csvSchemaFilePath.nonEmpty && maxCharsPerCell > 0 && maxNumOfLines > 0
163163

164164
def logRowCallback(maxBadLines: Int)(row: ValidatedNel[FailMessage, Any]): Unit = row match {
165165
case Invalid(failures) =>

0 commit comments

Comments
 (0)