From 6087602f560ed6da05de57cef161249f2ad92fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Smestad?= Date: Thu, 26 Sep 2019 17:58:14 +0200 Subject: [PATCH 1/2] When getting diffs for binary files with BitBucket Server, Danger fails when trying to map over chunks This fix avoids setting the `chunks` property in `structuredDiffForFile` if it is `undefined`. --- source/platforms/git/gitJSONToGitDSL.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/platforms/git/gitJSONToGitDSL.ts b/source/platforms/git/gitJSONToGitDSL.ts index 9ac06c4f9..ed7b83494 100644 --- a/source/platforms/git/gitJSONToGitDSL.ts +++ b/source/platforms/git/gitJSONToGitDSL.ts @@ -197,7 +197,7 @@ export const gitJSONToGitDSL = (gitJSONRep: GitJSONDSL, config: GitJSONToGitDSLC fileDiffs = parseDiff(diff) } const structuredDiff = fileDiffs.find(diff => diff.from === filename || diff.to === filename) - if (structuredDiff !== undefined) { + if (structuredDiff !== undefined && structuredDiff.chunks !== undefined) { return { chunks: structuredDiff.chunks } } else { return null From 5194b63aed170881f52b8127876fea2ec053b64b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Smestad?= Date: Thu, 26 Sep 2019 18:03:38 +0200 Subject: [PATCH 2/2] Update Changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f07950b1..a9861ad70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,8 @@ - +- Fix binary files for BitBucket Server - [@osmestad] + # 9.2.1