From a85126ea9785dc0bbb8d950d2662ebafca0f6aca Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 31 Oct 2016 12:17:50 -0400 Subject: [PATCH 1/3] Prevent NPE in delete namespace Fixes #2039 --- static/js/services/user-service.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/static/js/services/user-service.js b/static/js/services/user-service.js index 6a7d82c26..b60f97806 100644 --- a/static/js/services/user-service.js +++ b/static/js/services/user-service.js @@ -171,6 +171,10 @@ function(ApiService, CookieService, $rootScope, Config, $location) { userService.deleteNamespace = function(info, callback) { var namespace = info.user ? info.user.username : info.organization.name; + if (!namespace) { + return; + } + var deleteNamespaceItself = function() { info.progress = 1; info.progressMessage = 'Deleting namespace...'; From 604c67948a04005ccdc98ec994e51b97e69f563f Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 31 Oct 2016 12:19:43 -0400 Subject: [PATCH 2/3] 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']; From 73b81c6cd2745e3876623eb56771dca671e61ea2 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 31 Oct 2016 12:20:55 -0400 Subject: [PATCH 3/3] Munchkin may not init properly, resulting in a ref error Fixes #2043 --- templates/base.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/base.html b/templates/base.html index d5f03c88b..3dfb32198 100644 --- a/templates/base.html +++ b/templates/base.html @@ -81,6 +81,10 @@ function initMunchkin() { if(didInit === false) { didInit = true; + if (!Munchkin || !Munchkin.init) { + return; + } + Munchkin.init('{{ munchkin_key }}'); window.__quay_munchkin_queue.forEach(function(queue_item) { Munchkin.munchkinFunction.apply(Munchkin, queue_item);