diff --git a/lib/github-helpers.js b/lib/github-helpers.js index 895947c..1b34d9b 100644 --- a/lib/github-helpers.js +++ b/lib/github-helpers.js @@ -82,6 +82,10 @@ async function _getProjectCardForIssue (github, columnId, issueUrl) { } async function _getOrgProjectByName (github, robot, orgName, projectName, botName) { + if (!projectName) { + return null + } + try { // Fetch org projects // TODO: The org project and project column info should be cached @@ -107,6 +111,10 @@ async function _getOrgProjectByName (github, robot, orgName, projectName, botNam } async function _getRepoProjectByName (github, robot, repoInfo, projectName, botName) { + if (!projectName) { + return null + } + try { const ghprojectsPayload = await github.projects.getRepoProjects({ ...repoInfo, state: 'open' }) const project = ghprojectsPayload.data.find(p => p.name === projectName) @@ -128,6 +136,9 @@ async function _getProjectColumnByName (github, robot, project, columnName, botN if (!project) { return null } + if (!columnName) { + return null + } try { const ghcolumnsPayload = await github.projects.getProjectColumns({ project_id: project.id })