Fix NPE in activate trigger

Fixes #2042
This commit is contained in:
Joseph Schorr 2016-10-31 12:19:43 -04:00
parent a85126ea97
commit 604c67948a

View file

@ -99,6 +99,10 @@ angular.module('quay').directive('setupTriggerDialog', function () {
};
$scope.activate = function() {
if (!$scope.trigger) {
return;
}
var params = {
'repository': $scope.repository.namespace + '/' + $scope.repository.name,
'trigger_uuid': $scope.trigger.id
@ -123,6 +127,10 @@ angular.module('quay').directive('setupTriggerDialog', function () {
});
ApiService.activateBuildTrigger(data, params).then(function(resp) {
if (!$scope.trigger) {
return;
}
$scope.trigger['is_active'] = true;
$scope.trigger['config'] = resp['config'];
$scope.trigger['pull_robot'] = resp['pull_robot'];