WW-3406 Solves NPE problem

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1458537 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/struts2/jsf/StrutsNavigationHandler.java b/src/main/java/org/apache/struts2/jsf/StrutsNavigationHandler.java
index 1ad62a4..b0e4f03 100644
--- a/src/main/java/org/apache/struts2/jsf/StrutsNavigationHandler.java
+++ b/src/main/java/org/apache/struts2/jsf/StrutsNavigationHandler.java
@@ -21,15 +21,14 @@
 
 package org.apache.struts2.jsf;
 
-import java.util.Map;
-
-import javax.faces.application.NavigationHandler;
-import javax.faces.context.FacesContext;
-
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.config.entities.ActionConfig;
 import com.opensymphony.xwork2.config.entities.ResultConfig;
 
+import javax.faces.application.NavigationHandler;
+import javax.faces.context.FacesContext;
+import java.util.Map;
+
 /**
  * Overrides the JFS navigation by delegating the result to handling by the core
  * result code lookup and execution.  If a result cannot be found, the previous
@@ -60,7 +59,7 @@
     public void handleNavigation(FacesContext facesContext, String fromAction, String outcome) {
         ActionContext ctx = ActionContext.getContext();
         if (outcome != null) {
-            if (ctx == null && ctx.getActionInvocation() == null) {
+            if (ctx == null || ctx.getActionInvocation() == null) {
                 delegateToParentNavigation(facesContext, fromAction, outcome);
             } else {
                 ActionConfig config = ctx.getActionInvocation().getProxy().getConfig();