Update index.js

This commit is contained in:
Benjamin Lannon 2018-12-05 20:53:51 -05:00
commit 9ce7cfa445

View file

@ -19,7 +19,11 @@ async function run() {
newLabels.forEach(async label => { newLabels.forEach(async label => {
let { name, color, description } = label; let { name, color, description } = label;
let idx = labels.indexOf(issue => issue.name === name); let idx = -1;
if (labels.length > 0) {
idx = labels.indexOf(issue => issue.name === name);
}
if (idx !== -1) { if (idx !== -1) {
let params = tools.context.repo({ let params = tools.context.repo({