diff --git a/packages/gradle/src/utils/get-gradle-report.ts b/packages/gradle/src/utils/get-gradle-report.ts index 2dbc0e99d77c2..81a885291d833 100644 --- a/packages/gradle/src/utils/get-gradle-report.ts +++ b/packages/gradle/src/utils/get-gradle-report.ts @@ -252,7 +252,11 @@ export function processProjectReports( if (tasksFileLines[i + 1] === dashes) { const type = line.substring(0, line.length - ' tasks'.length); i++; - while (tasksFileLines[++i] !== '') { + while ( + tasksFileLines[++i] !== '' && + i < tasksFileLines.length && + tasksFileLines[i]?.includes(' - ') + ) { const [taskName] = tasksFileLines[i].split(' - '); taskTypeMap.set(taskName, type); }