thymeleaf / thymeleaf-extras-tiles2

Thymeleaf integration with Apache Tiles 2.x
http://www.thymeleaf.org
36 stars 18 forks source link

NullPointerException on null model in ThymeleafTilesView #4

Closed KaRkY closed 12 years ago

KaRkY commented 12 years ago

I'm using spring mvc and when there is no model for the view NullPointerException is thrown.

Relevant stack trace: java.lang.NullPointerException org.thymeleaf.extras.tiles2.spring.web.view.ThymeleafTilesView.exposeModelAsRequestAttributes(ThymeleafTilesView.java:176) org.thymeleaf.extras.tiles2.spring.web.view.ThymeleafTilesView.render(ThymeleafTilesView.java:130) org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)

I looked at the code and i think that line 130: exposeModelAsRequestAttributes(model, request); should be: exposeModelAsRequestAttributes(mergedModel, request);

danielfernandez commented 12 years ago

Fixed in 1.0-master, uploaded new 1.0.0-beta2-SNAPSHOT version. See http://www.thymeleaf.org/faq.html in order to learn how to use a snapshot version.

Thanks a lot for reporting.