java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartDetailsEditAction.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
New commits:
commit 4003937da4077c674d6b60b52a506da5728a37ef
Author: Johannes Renner <jrenner(a)suse.de>
Date: Wed Dec 18 09:38:52 2013 -0500
1039193 - fixing null pointer exception
diff --git a/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartDetailsEditAction.java b/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartDetailsEditAction.java
index 850dba5..0dfda3d 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartDetailsEditAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartDetailsEditAction.java
@@ -290,9 +290,11 @@ public class KickstartDetailsEditAction extends BaseKickstartEditAction {
*/
public static void processCobblerFormValues(KickstartData ksdata, DynaActionForm form,
User user) throws ValidatorException {
- int virtMemory = (Integer) form.get(VIRT_MEMORY);
- if (ksdata.isRhel7OrGreater() && virtMemory < 768) {
- ValidatorException.raiseException("kickstart.cobbler.profile.notenoughmemory");
+ if (KickstartDetailsEditAction.canSaveVirtOptions(ksdata, form)) {
+ int virtMemory = (Integer) form.get(VIRT_MEMORY);
+ if (ksdata.isRhel7OrGreater() && virtMemory < 768) {
+ ValidatorException.raiseException("kickstart.cobbler.profile.notenoughmemory");
+ }
}
CobblerProfileEditCommand cmd = new CobblerProfileEditCommand(ksdata, user);
@@ -309,7 +311,7 @@ public class KickstartDetailsEditAction extends BaseKickstartEditAction {
}
if (KickstartDetailsEditAction.canSaveVirtOptions(ksdata, form)) {
- prof.setVirtRam(virtMemory);
+ prof.setVirtRam((Integer) form.get(VIRT_MEMORY));
prof.setVirtCpus((Integer) form.get(VIRT_CPU));
prof.setVirtFileSize((Integer) form.get(VIRT_DISK_SIZE));
prof.setVirtBridge(form.getString(VIRT_BRIDGE));