Skip to content

Commit 0aa9fa6

Browse files
authoredJul 6, 2020
Merge pull request #106 from davidbilik/fix/invalid-diff
Fix invalid parsing of changes in diff
2 parents dae9740 + d517003 commit 0aa9fa6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
-->
1313

1414
## Master
15-
15+
- Fix invalid parsing of changes in diff [@davidbilik][] - [#106](https://github.com/danger/kotlin/pull/106)
1616
- Add extensions for changed lines in Git [@davidbilik][] - [#102](https://github.com/danger/kotlin/pull/102)
1717
- Add exec function [@f-meloni][] - [#97](https://github.com/danger/kotlin/pull/97)
1818
- Add readFile function [@f-meloni][] - [#93](https://github.com/danger/kotlin/pull/93)

‎danger-kotlin-library/src/main/kotlin/systems/danger/kotlin/GitKtx.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ val Git.changedLines: PullRequestChangedLines
1414
.filter { it.isNotEmpty() }
1515
.map { line ->
1616
val parts = line.split("\\s+".toRegex())
17-
parts[0].toInt() to parts[1].toInt()
17+
(parts[0].toIntOrNull() ?: 0) to (parts[1].toIntOrNull() ?: 0)
1818
}
1919
val additions = additionDeletionPairs.fold(0) { acc, (addition, _) -> acc + addition }
2020
val deletions = additionDeletionPairs.fold(0) { acc, (_, deletion) -> acc + deletion }

0 commit comments

Comments
 (0)