Skip to content

Commit 49ce0ec

Browse files
committed
Avoid ArrayIndexOutOfBoundsException when slurm line has empty values
1 parent 81f5c87 commit 49ce0ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cluster/src/org/labkey/cluster/pipeline/SlurmExecutionEngine.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ else if (headerFound)
277277
}
278278
}
279279

280-
if (maxRssIdx > -1)
280+
// NOTE: if the line has blank ending columns, trimmed lines might lack that value
281+
if (maxRssIdx > -1 && maxRssIdx < tokens.length)
281282
{
282283
long bytes = FileSizeFormatter.convertStringRepresentationToBytes(tokens[maxRssIdx]);
283284
long requestInBytes = FileSizeFormatter.convertBytesToUnit(getConfig().getRequestMemory(), 'G');

0 commit comments

Comments
 (0)