You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mm...@apache.org on 2006/09/21 10:55:18 UTC

svn commit: r448497 - /myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java

Author: mmarinschek
Date: Thu Sep 21 01:55:18 2006
New Revision: 448497

URL: http://svn.apache.org/viewvc?view=rev&rev=448497
Log:
Fix for NullPointerException

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java?view=diff&rev=448497&r1=448496&r2=448497
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/renderkit/html/util/AutoScrollPhaseListener.java Thu Sep 21 01:55:18 2006
@@ -49,15 +49,18 @@
 
     public void afterPhase(PhaseEvent event)
     {
-        FacesContext facesContext = event.getFacesContext();
-        UIViewRoot view = facesContext.getViewRoot();
-        if(view != null)
+        if(event != null)
         {
-            String viewId = view.getViewId();
-            if (viewId != null)
+            FacesContext facesContext = event.getFacesContext();
+            UIViewRoot view = facesContext.getViewRoot();
+            if(view != null)
             {
-                JavascriptUtils.setOldViewId(facesContext.getExternalContext(), viewId);
-            }   
+                String viewId = view.getViewId();
+                if (viewId != null)
+                {
+                    JavascriptUtils.setOldViewId(facesContext.getExternalContext(), viewId);
+                }   
+            }
         }
     }