From 8f1ef26ead00f2449c857b6e47aeed826916c13e Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 5 Jan 2012 15:45:26 +0000 Subject: [PATCH] fix NPE when role doesn't have any users affected git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1227644 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva-webapp-js/src/main/webapp/js/redback/roles.js | 2 +- .../src/main/webapp/js/redback/templates/roles-tmpl.html | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js index 40af9865f..da7922d59 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js @@ -24,7 +24,7 @@ $(function() { this.assignable = ko.observable(assignable); this.childRoleNames = ko.observableArray(childRoleNames);//read only this.parentRoleNames = ko.observableArray(parentRoleNames);//read only - this.users = ko.observableArray(users); + this.users = ko.observableArray(users?users:new Array()); this.parentsRolesUsers = ko.observableArray(parentsRolesUsers);//read only this.permissions = ko.observableArray(permissions);//read only // when editing a role other users not assign to this role are populated diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html index b6c9c506f..63dfdc29f 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html @@ -129,12 +129,9 @@ {{else}} ${$.i18n.prop('role.edit.no.user.defined')} {{/if}} - - - -