WW-5070 Uses else if to avoid double operation on stack

This commit is contained in:
Lukasz Lenart
2020-04-27 08:19:29 +02:00
parent 333f781207
commit 48435c4209
@@ -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();
}
}