Skip to content

Commit

Permalink
fix(excel): handle missing rows correctly (#1700)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zitrone44 authored Nov 1, 2024
1 parent 20423dd commit 4130640
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class ExcelCheckerService extends CheckerService with CheckerServiceOnMainFileUp
}

private def generateCheckResultError(errorMsg: String, args: Any*): CheckResultTask = {
CheckResultTask(success = false, List(CheckResult(errorMsg = errorMsg.format(args))))
CheckResultTask(success = false, List(CheckResult(errorMsg = errorMsg.format(args: _*))))
}

private def storeError(submissionID: Int, cc: CheckrunnerConfiguration, errorMsg: String): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ class ExcelService {

private def getCell(sheet: XSSFSheet, cell: String) = {
val cords = this.parseCellAddress(cell)
val col = sheet.getRow(cords.row).getCell(cords.col)
val row = sheet.getRow(cords.row)
if (row == null) throw new Exception(cords.row, cords.col, s"Cell '$cell' Not Found")
val col = row.getCell(cords.col)
if (col == null) throw new Exception(cords.row, cords.col, s"Cell '$cell' Not Found")

col
Expand Down

0 comments on commit 4130640

Please sign in to comment.