Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
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
5 changes: 5 additions & 0 deletions services/IssueService.js
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,11 @@ async function handleIssueUnAssignment(event, issue) {

if (dbIssue.assignee) {
const assigneeUserId = gitHelper.getUserIdByLogin(event, dbIssue.assignee);
if (!assigneeUserId) {
// The assignement of this user was failed and broken.
// We don't need to handle the unassignment.
return;
}
logger.debug(`Looking up TC handle of git user: ${assigneeUserId}`);
const userMapping = await userService.getTCUserName(event.provider, assigneeUserId);

Expand Down
3 changes: 3 additions & 0 deletions services/UserService.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ async function getTCUserName(provider, gitUser) {
criteria.gitlabUsername = gitUser;
}
}
if (_.isEmpty(criteria)) {
throw new Error('Can\'t find the TCUserName. Invalid gitUser.');
}
return await dbHelper.scanOne(models.UserMapping, criteria);
}

Expand Down