CQ5 NPE when Resource has no path

Developing a custom Sling ResourceProvider you can get this kind of NullPointerException:

22.03.2010 15:55:41.417 *ERROR* [127.0.0.1 [1269269683276] GET /content/mynamespace/products/6 HTTP/1.1] org.apache.sling.engine.impl.SlingMainServlet service: Uncaught Throwable java.lang.NullPointerException

    at com.day.cq.wcm.core.impl.WCMRequestFilter.filterRootInclude(WCMRequestFilter.java:275)

    at com.day.cq.wcm.core.impl.WCMRequestFilter.doFilter(WCMRequestFilter.java:161)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)

    at org.apache.sling.engine.impl.SlingMainServlet.processRequest(SlingMainServlet.java:427)

    at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:48)

    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64)

    .....

    .....

    .....

    .....

    at com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:378)

    at com.day.j2ee.servletengine.ServletHandlerImpl.execute(ServletHandlerImpl.java:313)

    at com.day.j2ee.servletengine.DefaultThreadPool$DequeueThread.run(DefaultThreadPool.java:134)

    at java.lang.Thread.run(Thread.java:619)

Debbugging I saw that:

From this we can learn three things: