Skip to content

Commit 7f09a25

Browse files
authored
fix: handle non-array contributions in unmerge preview (#3587)
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
1 parent 6e1db36 commit 7f09a25

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

backend/src/services/memberService.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,8 +958,11 @@ export default class MemberService extends LoggerBase {
958958
} else if (key === 'contributions') {
959959
// check secondary member has any contributions to extract from current member
960960
if (member.contributions && Array.isArray(member.contributions)) {
961+
const secondaryContributions = Array.isArray(secondaryBackup.contributions)
962+
? secondaryBackup.contributions
963+
: []
961964
member.contributions = member.contributions.filter(
962-
(c) => !(secondaryBackup.contributions || []).some((s) => s.id === c.id),
965+
(c) => !secondaryContributions.some((s) => s.id === c.id),
963966
)
964967
}
965968
} else if (

0 commit comments

Comments
 (0)