Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ export class GithubIntegrationService extends IntegrationServiceBase {
for (const record of records) {
switch (record.__typename) {
case GithubPullRequestEvents.ASSIGN:
if (record.actor.login && record.assignee.login) {
if (record.actor?.login && record.assignee?.login) {
const member = await GithubIntegrationService.parseMember(record.actor, context)
const objectMember = await GithubIntegrationService.parseMember(
record.assignee,
Expand Down Expand Up @@ -1678,7 +1678,7 @@ export class GithubIntegrationService extends IntegrationServiceBase {
for (const record of records) {
switch (record.__typename) {
case GithubPullRequestEvents.CLOSE:
if (record.actor.login) {
if (record.actor?.login) {
const member = await GithubIntegrationService.parseMember(record.actor, context)
out.push({
username: member.username[PlatformType.GITHUB].username,
Expand Down
8 changes: 5 additions & 3 deletions backend/src/services/memberService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,11 @@ export default class MemberService extends LoggerBase {
// Fetch organization ids for these domains
const organizationService = new OrganizationService(this.options)
for (const domain of emailDomains) {
const organizationRecord = await organizationService.findByUrl(domain)
if (organizationRecord) {
organizations.push(organizationRecord.id)
if (domain) {
const organizationRecord = await organizationService.findByUrl(domain)
if (organizationRecord) {
organizations.push(organizationRecord.id)
}
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions services/libs/integrations/src/integrations/activityTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export const DEFAULT_ACTIVITY_TYPE_SETTINGS: DefaultActivityTypes = {
formatter: {
channel: defaultGithubChannelFormatter,
self: (activity) => {
const prNumberAndTitle = `#${activity.url.split('/')[6]} ${activity.parent.title}`
const prNumberAndTitle = `#${activity.url.split('/')[6]} ${activity.parent?.title}`
return `<a href="${activity.url}" target="_blank">${prNumberAndTitle}</a>`
},
},
Expand All @@ -211,7 +211,7 @@ export const DEFAULT_ACTIVITY_TYPE_SETTINGS: DefaultActivityTypes = {
formatter: {
channel: defaultGithubChannelFormatter,
self: (activity) => {
const prNumberAndTitle = `#${activity.url.split('/')[6]} ${activity.parent.title}`
const prNumberAndTitle = `#${activity.url.split('/')[6]} ${activity.parent?.title}`
return `<a href="${activity.url}" style="max-width:150px" target="_blank">${prNumberAndTitle}</a> to <a href="/members/${activity.objectMemberId}" target="_blank">${activity.objectMember.displayName}</a>`
},
},
Expand All @@ -226,7 +226,7 @@ export const DEFAULT_ACTIVITY_TYPE_SETTINGS: DefaultActivityTypes = {
formatter: {
channel: defaultGithubChannelFormatter,
self: (activity) => {
const prNumberAndTitle = `#${activity.url.split('/')[6]} ${activity.parent.title}`
const prNumberAndTitle = `#${activity.url.split('/')[6]} ${activity.parent?.title}`
return `<a href="${activity.url}" target="_blank">${prNumberAndTitle}</a>`
},
},
Expand All @@ -241,7 +241,7 @@ export const DEFAULT_ACTIVITY_TYPE_SETTINGS: DefaultActivityTypes = {
formatter: {
channel: defaultGithubChannelFormatter,
self: (activity) => {
const prNumberAndTitle = `#${activity.url.split('/')[6]} ${activity.parent.title}`
const prNumberAndTitle = `#${activity.url.split('/')[6]} ${activity.parent?.title}`
return `<a href="${activity.url}" style="max-width:150px" target="_blank">${prNumberAndTitle}</a> from <a href="/members/${activity.objectMemberId}" target="_blank">${activity.objectMember.displayName}</a>`
},
},
Expand All @@ -257,7 +257,7 @@ export const DEFAULT_ACTIVITY_TYPE_SETTINGS: DefaultActivityTypes = {
channel: defaultGithubChannelFormatter,
self: (activity) => {
const prNumberAndTitle = `#${activity.url.split('/')[6].split('#')[0]} ${
activity.parent.title
activity.parent?.title
}`
return `<a href="${activity.url}" style="max-width:150px" target="_blank">${prNumberAndTitle}</a>`
},
Expand Down