fix: add check for existence of lines in jacoco converter

Signed-off-by: Jonah Back <jonah@jonahback.com>
This commit is contained in:
Jonah Back
2021-10-07 13:36:50 -07:00
parent f00e7ababe
commit 6956ae1547
2 changed files with 2 additions and 2 deletions
@@ -83,7 +83,7 @@ export class Jacoco implements Converter {
private extractLines(sourcefile: JacocoSourceFile): ParsedLine[] {
const parsed: ParsedLine[] = [];
sourcefile.line.forEach(l => {
sourcefile.line?.forEach(l => {
parsed.push({
number: parseInt(l.$.nr, 10),
missed_instructions: parseInt(l.$.mi, 10),
@@ -79,7 +79,7 @@ export type JacocoSourceFile = {
$: {
name: string;
};
line: JacocoLine[];
line: JacocoLine[] | undefined;
};
export type JacocoLine = {
$: {