Skip to content

Commit 0869a34

Browse files
authored
Fail if splitFastq receives incomplete record (#6268)
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
1 parent 9e9476f commit 0869a34

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

modules/nextflow/src/main/groovy/nextflow/splitter/FastqSplitter.groovy

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,17 @@ class FastqSplitter extends AbstractTextSplitter {
134134
@Override
135135
protected fetchRecord(BufferedReader reader) {
136136

137-
def l1 = reader.readLine()
138-
def l2 = reader.readLine()
139-
def l3 = reader.readLine()
140-
def l4 = reader.readLine()
137+
final l1 = reader.readLine()
138+
final l2 = reader.readLine()
139+
final l3 = reader.readLine()
140+
final l4 = reader.readLine()
141141

142-
if( !l1 || !l2 || !l3 || !l4 )
142+
if( !l1 && !l2 && !l3 && !l4 )
143143
return null
144144

145+
if( !l1 || !l2 || !l3 || !l4 )
146+
throw new IllegalStateException(errorMessage)
147+
145148
if( !l1.startsWith('@') || !l3.startsWith('+') )
146149
throw new IllegalStateException(errorMessage)
147150

0 commit comments

Comments
 (0)