diff --git a/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java b/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java index bb35bf2de..ba46d96be 100644 --- a/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java +++ b/plugins/json/src/main/java/org/apache/struts2/json/JSONResult.java @@ -224,9 +224,8 @@ public class JSONResult implements Result { if (rootObject instanceof ModelDriven) { LOG.debug("Action is an instance of ModelDriven, assuming model is on the top of the stack and using it"); rootObject = stack.peek(); - } - if (rootObject == null) { - LOG.debug("Neither #action nor ModelDriven, peeking up object from top of the stack"); + } else if (rootObject == null) { + LOG.debug("Neither #action nor ModelDriven, peeking up object from the top of the stack"); rootObject = stack.peek(); } }