Fix build view when job_config is missing

This commit is contained in:
Joseph Schorr 2015-03-17 16:56:21 -04:00
parent 56be893d7e
commit 3cd867b3ab

View file

@ -37,14 +37,15 @@ angular.module('quay').directive('repoPanelBuilds', function () {
var unordered = $scope.allBuilds.map(function(build_info) {
var commit_sha = null;
var job_config = build_info.job_config || {};
if (build_info.job_config.trigger_metadata) {
commit_sha = build_info.job_config.trigger_metadata.commit_sha;
if (job_config.trigger_metadata) {
commit_sha = job_config.trigger_metadata.commit_sha;
}
return $.extend(build_info, {
'started_datetime': (new Date(build_info.started)).valueOf() * (-1),
'building_tags': build_info.job_config.docker_tags,
'building_tags': job_config.docker_tags || [],
'commit_sha': commit_sha
});
});