Description
LifecycleImpl's restoreView throws exception when viewId is null and in a portlet context
In restoreView:
if(viewId == null)
{
ExternalContext externalContext = facesContext.getExternalContext();
if(!externalContext.getRequestServletPath().endsWith("/"))
In a portlet context getRequestServletPath() returns null by definition. Not only should we avoid the NPE, but we should do something appropriate for portlets (return to the 'default-view')