Commits

Anonymous committed 3a6fd2d

XW-140: Avoid NPE when the result is null

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@175e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 04bb252

Comments (0)

Files changed (1)

src/java/com/opensymphony/xwork/DefaultActionInvocation.java

 import com.opensymphony.xwork.interceptor.PreResultListener;
 import com.opensymphony.xwork.util.OgnlUtil;
 import com.opensymphony.xwork.util.OgnlValueStack;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
-
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
 
 /**
- *
- *
  * @author $Author$
  * @version $Revision$
  */
      * will walk down the chain of ActionChainResults until it finds a non-chain result, which will be returned. If the
      * DefaultActionInvocation's result has not been executed before, the Result instance will be created and populated with
      * the result params.
+     *
      * @return a Result instance
      * @throws Exception
      */
      * Register a com.opensymphony.xwork.interceptor.PreResultListener to be notified after the Action is executed and before the
      * Result is executed. The ActionInvocation implementation must guarantee that listeners will be called in the order
      * in which they are registered. Listener registration and execution does not need to be thread-safe.
+     *
      * @param listener
      */
     public void addPreResultListener(PreResultListener listener) {
         if (!executed) {
             if (preResultListeners != null) {
                 for (Iterator iterator = preResultListeners.iterator();
-                        iterator.hasNext();) {
+                     iterator.hasNext();) {
                     PreResultListener listener = (PreResultListener) iterator.next();
                     listener.beforeResult(this, resultCode);
                 }
 
         if (result != null) {
             result.execute(this);
-        } else if (!resultCode.equals(Action.NONE)) {
+        } else if (!Action.NONE.equals(resultCode)) {
             LOG.warn("No result defined for action " + getAction().getClass().getName() + " and result " + getResultCode());
         }
     }