openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r894276 - /openwebbeans/trunk/webbeans-jsf/src/main/java/org/apache/webbeans/util/JSFUtil.java
Date Mon, 28 Dec 2009 23:31:32 GMT
Author: struberg
Date: Mon Dec 28 23:31:32 2009
New Revision: 894276

URL: http://svn.apache.org/viewvc?rev=894276&view=rev
Log:
OWB-211 JSFUtil.getViewId() crashes if viewRoot is not yet set

Modified:
    openwebbeans/trunk/webbeans-jsf/src/main/java/org/apache/webbeans/util/JSFUtil.java

Modified: openwebbeans/trunk/webbeans-jsf/src/main/java/org/apache/webbeans/util/JSFUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-jsf/src/main/java/org/apache/webbeans/util/JSFUtil.java?rev=894276&r1=894275&r2=894276&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-jsf/src/main/java/org/apache/webbeans/util/JSFUtil.java (original)
+++ openwebbeans/trunk/webbeans-jsf/src/main/java/org/apache/webbeans/util/JSFUtil.java Mon
Dec 28 23:31:32 2009
@@ -21,7 +21,6 @@
 import javax.faces.context.FacesContext;
 import javax.servlet.http.HttpSession;
 
-import org.apache.webbeans.jsf.WebBeansPhaseListener;
 
 public final class JSFUtil
 {
@@ -66,7 +65,12 @@
 
     public static String getViewId()
     {
-        return getCurrentFacesContext().getViewRoot().getViewId();
+        UIViewRoot viewRoot = getCurrentFacesContext().getViewRoot();
+        if (viewRoot == null)
+        {
+            return null;
+        }
+        return viewRoot.getViewId();
     }
 
     public static ViewHandler getViewHandler()



Mime
View raw message