Nullpointer in AutoScrollerPhaseListener when using weblets and a request for a 
resource comes in.
--------------------------------------------------------------------------------------------------

                 Key: TOMAHAWK-644
                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-644
             Project: MyFaces Tomahawk
          Issue Type: Bug
    Affects Versions: 1.1.4-SNAPSHOT
            Reporter: Tim


AutoScrollPhaseListener test if the viewId is null

....
        String viewId = facesContext.getViewRoot().getViewId();
        if (viewId != null)
        {
.....

However when using weblets and a non jsf call comes in the view root is null 
and a warning gets printed:

WARNING: phase(RESTORE_VIEW 1,[EMAIL PROTECTED]) threw exception: 
java.lang.NullPointerException null
org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener.afterPhase(AutoScrollPhaseListener.java:52)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:274)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:113)

The fix is to check if the viewroot is null also

        String viewId = facesContext.getViewRoot().getViewId();
        if (viewId != null)
        {


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to