myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1532235 - /myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationState.java
Date Tue, 15 Oct 2013 07:50:10 GMT
Author: lofwyr
Date: Tue Oct 15 07:50:09 2013
New Revision: 1532235

URL: http://svn.apache.org/r1532235
Log:
prevent NPE

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationState.java

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationState.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationState.java?rev=1532235&r1=1532234&r2=1532235&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationState.java
(original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxNavigationState.java
Tue Oct 15 07:50:09 2013
@@ -116,15 +116,27 @@ public class AjaxNavigationState {
   }
 
   public static void storeIncomingView(FacesContext facesContext) {
-    UIViewRoot viewRoot = facesContext.getViewRoot();
-    LOG.trace("incoming viewId = \"{}\"", viewRoot.getViewId());
+    final UIViewRoot viewRoot = facesContext.getViewRoot();
+    if (LOG.isTraceEnabled()) {
+      if (viewRoot != null) {
+        LOG.trace("incoming viewId = '{}'", viewRoot.getViewId());
+      } else {
+        LOG.trace("incoming viewRoot is null");
+      }
+    }
     facesContext.getExternalContext().getRequestMap().put(AjaxNavigationState.VIEW_ROOT_KEY,
viewRoot);
   }
 
   public static boolean isNavigation(FacesContext facesContext) {
 
     final UIViewRoot viewRoot = facesContext.getViewRoot();
-    LOG.trace("current viewId = \"{}\"", viewRoot.getViewId());
+    if (LOG.isTraceEnabled()) {
+      if (viewRoot != null) {
+        LOG.trace("current viewId = '{}'", viewRoot.getViewId());
+      } else {
+        LOG.trace("current viewRoot is null");
+      }
+    }
 
     ExternalContext externalContext = facesContext.getExternalContext();
     Map<String, Object> requestMap = externalContext.getRequestMap();



Mime
View raw message