title: SendRedirect at autoLogin
body: <p>AutoLogin. The following exception occurs when trying to redirect to my custom portlet when user does not exist.</p>
  
  <pre><code>java.lang.NullPointerException
  at com.liferay.portlet.PortletURLImpl.generateToString(PortletURLImpl.java:850)
  at com.liferay.portlet.PortletURLImpl$ToStringPrivilegedAction.run(PortletURLImpl.java:1501)
  at com.liferay.portlet.PortletURLImpl$ToStringPrivilegedAction.run(PortletURLImpl.java:1)
  at com.liferay.portal.security.lang.DoPrivilegedUtil$NoPACL.wrap(DoPrivilegedUtil.java:64)
  at com.liferay.portal.security.lang.DoPrivilegedUtil.wrap(DoPrivilegedUtil.java:26)
  at com.liferay.portlet.PortletURLImpl.toString(PortletURLImpl.java:740)
  </code></pre>
  
  <p>when trying to call this</p>
  
  <pre><code>PortletURL portletURL = getRenderURL(request, somePortletName, somePlid);
  response.sendRedirect(portletURL.toString());
  
  public static PortletURL getRenderURL(HttpServletRequest request, String portletId, long plid)
  {
      return PortletURLFactoryUtil.create(
  
              request,
              portletId,
              plid,
              PortletRequest.RENDER_PHASE);
  }
  </code></pre>
  
  <p>Is it forbidden to call sendRedirect in autologin or can You suggest me a workarround? story: after singleSignOn, if the user does not exists in liferay, it redirects him to my custom registration form and pre-fill retrieved known data.</p>