diff options
author | Olivier Lamy <olamy@apache.org> | 2013-04-18 12:43:25 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2013-04-18 12:43:25 +0000 |
commit | 3bba579fe447220c19be0dc4e8dc88c7168afe70 (patch) | |
tree | 4863fb1a172c057b931898d53855b4ff3f1ad94d /archiva-modules/archiva-web | |
parent | 1c655131b0ee24ecc918233132e3f7a68f424cc5 (diff) | |
download | archiva-3bba579fe447220c19be0dc4e8dc88c7168afe70.tar.gz archiva-3bba579fe447220c19be0dc4e8dc88c7168afe70.zip |
fix possible javascript npe
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1469298 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web')
-rw-r--r-- | archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js index 547254bc4..92fd0b3b8 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/general-admin.js @@ -1906,6 +1906,8 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" ||$.inArray("ldap",redbackRuntimeConfiguration.rbacManagerImpls())>=0; $.log("useLdap:"+useLdap); if(useLdap){ + $.log("in get ldap groups"); + // load ldap roles $.ajax("restServices/redbackServices/ldapGroupMappingService/ldapGroups", { type: "GET", @@ -1939,6 +1941,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" } ); } else { + $.log("before displayRuntimeConfigurationScreen"); displayRuntimeConfigurationScreen(redbackRuntimeConfigurationViewModel,null,null); } } @@ -1955,7 +1958,8 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" }); redbackRuntimeConfigurationViewModel.allRoleNames=ko.observableArray(allRoleNames); - if (redbackRuntimeConfigurationViewModel.redbackRuntimeConfiguration().ldapConfiguration().useRoleNameAsGroup()) { + + if (redbackRuntimeConfigurationViewModel.redbackRuntimeConfiguration().ldapConfiguration().useRoleNameAsGroup()&&groups) { // if using groups == roles add all as mapping except already mapped $.each(groups,function(idx,item){ var exists=false; @@ -1971,6 +1975,7 @@ define("archiva.general-admin",["jquery","i18n","utils","jquery.tmpl","knockout" }); } + redbackRuntimeConfigurationViewModel.redbackRuntimeConfiguration().ldapGroupMappings=ko.observableArray(groupMappings?groupMappings:[]); redbackRuntimeConfigurationViewModel.redbackRuntimeConfiguration().modified(false); |