Fixed issue when there are no PR checks

This commit is contained in:
Ronnie Lazar 2021-07-06 12:53:29 +03:00
parent 2e2ad9556a
commit bbdc60dd42

View file

@ -50,7 +50,7 @@ setInterval(() => {
function createPrHTML(pr) { function createPrHTML(pr) {
const div = document.createElement('div'); const div = document.createElement('div');
const prState = pr.commits.nodes[0].commit.statusCheckRollup.state; const prState = pr.commits.nodes[0].commit.statusCheckRollup?.state || '';
const prStateColor = prState === 'FAILURE' ? 'red' : (prState === 'SUCCESS' ? 'green' : 'yellow'); const prStateColor = prState === 'FAILURE' ? 'red' : (prState === 'SUCCESS' ? 'green' : 'yellow');
div.className = "d-sm-flex Box mb-2 Box-body color-bg-secondary"; div.className = "d-sm-flex Box mb-2 Box-body color-bg-secondary";