java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelAction.java | 8 ++++++--
java/code/src/com/redhat/rhn/manager/ssm/SsmManager.java | 6 ++++--
2 files changed, 10 insertions(+), 4 deletions(-)
New commits:
commit a500cd4df0863138f9d949a4ef2262b17f83837f
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Thu Aug 23 12:17:42 2012 +0200
850836 - display an information message about no systems being selected
for SSM
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelAction.java
index c35e27a..0d5f056 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelAction.java
@@ -72,7 +72,10 @@ public class ChildChannelAction extends RhnAction {
// If submitted, save the user's choices for the confirm page
if (isSubmitted(daForm) && request.getParameter("dispatch") != null) {
- processList(user, request);
+ if (processList(user, request) == 0) {
+ createSuccessMessage(request, "ssmchildsubconfirm.jsp.noSystems", null);
+ return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
+ }
return mapping.findForward("success");
}
return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
@@ -134,7 +137,7 @@ public class ChildChannelAction extends RhnAction {
* @param user user making the request
* @param request http request to grab the user submitted data from
*/
- protected void processList(User user, HttpServletRequest request) {
+ protected int processList(User user, HttpServletRequest request) {
List<String> subList = new ArrayList<String>();
List<String> unsubList = new ArrayList<String>();
@@ -152,6 +155,7 @@ public class ChildChannelAction extends RhnAction {
}
storeChannelChanges(user, subList, unsubList);
+ return subList.size() + unsubList.size();
}
/**
commit eaa576f4a5ce3271eb94804a3ad0733d29ca36c7
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Wed Aug 22 18:52:15 2012 +0200
850836 - fix ISE on rhn/channel/ssm/ChildSubscriptions.do page
addressing:
java.lang.NullPointerException
at com.redhat.rhn.manager.ssm.SsmManager.verifyChildEntitlements(SsmMana
ger.java:79)
at com.redhat.rhn.frontend.action.channel.ssm.ChildChannelConfirmAction.
execute(ChildChannelConfirmAction.java:94)
diff --git a/java/code/src/com/redhat/rhn/manager/ssm/SsmManager.java b/java/code/src/com/redhat/rhn/manager/ssm/SsmManager.java
index 39fdd1a..ea0de7b 100644
--- a/java/code/src/com/redhat/rhn/manager/ssm/SsmManager.java
+++ b/java/code/src/com/redhat/rhn/manager/ssm/SsmManager.java
@@ -76,8 +76,10 @@ public class SsmManager {
RhnSet ssm = RhnSetDecl.SYSTEMS.lookup(user);
List<Server> servers = new ArrayList<Server>();
- for (RhnSetElement rse : ssm.getElements()) {
- servers.add(SystemManager.lookupByIdAndUser(rse.getElement(), user));
+ if (ssm != null) {
+ for (RhnSetElement rse : ssm.getElements()) {
+ servers.add(SystemManager.lookupByIdAndUser(rse.getElement(), user));
+ }
}
// Keeps a mapping of how many entitlements are left on each channel. This map