Skip to content

Commit

Permalink
(#3003) Handle lines with missing run type
Browse files Browse the repository at this point in the history
  • Loading branch information
squaregoldfish committed Nov 14, 2024
1 parent 516c172 commit f70da8b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,9 @@ public RunTypeAssignment getRunType(List<String> line, boolean followAlias)
*/
public RunTypeCategory getRunTypeCategory(String line)
throws FileDefinitionException {
return getRunType(line, true).getCategory();

RunTypeAssignment assignment = getRunType(line, true);
return null == assignment ? null : assignment.getCategory();
}

/**
Expand Down
14 changes: 11 additions & 3 deletions WebApp/src/uk/ac/exeter/QuinCe/jobs/files/ExtractDataSetJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,17 @@ protected void execute(JobThread thread) throws JobFailedException {

if (fileDefinition.hasRunTypes()) {
try {
RunTypeCategory runType = fileDefinition.getRunType(line, true)
.getCategory();
if (runType.equals(RunTypeCategory.IGNORED)) {
RunTypeCategory runType = null;

RunTypeAssignment runTypeAssignment = fileDefinition
.getRunType(line, true);

if (null != runTypeAssignment) {
runType = runTypeAssignment.getCategory();
}

if (null != runType
&& runType.equals(RunTypeCategory.IGNORED)) {
checkColumnCount = false;
}
} catch (FileDefinitionException e) {
Expand Down

0 comments on commit f70da8b

Please sign in to comment.