From 604c67948a04005ccdc98ec994e51b97e69f563f Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 31 Oct 2016 12:19:43 -0400 Subject: [PATCH] Fix NPE in activate trigger Fixes #2042 --- static/js/directives/ui/setup-trigger-dialog.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/static/js/directives/ui/setup-trigger-dialog.js b/static/js/directives/ui/setup-trigger-dialog.js index a9aa70c05..47e07b373 100644 --- a/static/js/directives/ui/setup-trigger-dialog.js +++ b/static/js/directives/ui/setup-trigger-dialog.js @@ -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'];