andriusvelykis / reflow-maven-skin

Reflow is an Apache Maven site skin built on Bootstrap. It allows various structural and stylistic customizations to create a modern-looking Maven-generated website.
http://andriusvelykis.github.io/reflow-maven-skin/
Apache License 2.0
132 stars 54 forks source link

NPE when menu item href is not set #8

Closed andriusvelykis closed 10 years ago

andriusvelykis commented 11 years ago

Got NullPointerException during site generation because menu item href attribute was not set in site.xml, e.g. <item name="Foo" />.

[INFO] Generating "Project Summary" report    --- maven-project-info-reports-plugin:2.6
[ERROR] Exception in macro #relativeLink called at META-INF/maven/site.vm[line 125, column 11]
[ERROR] Exception in macro #activeLink called at META-INF/maven/site.vm[line 815, column 27]
[ERROR] Exception in macro #displayTree called at META-INF/maven/site.vm[line 819, column 27]
[ERROR] Exception in macro #displayTree called at META-INF/maven/site.vm[line 819, column 27]
[ERROR] Exception in macro #displayTree called at META-INF/maven/site.vm[line 148, column 27]
[ERROR] Exception in macro #topMenu called at META-INF/maven/site.vm[line 1463, column 19]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.798s
[INFO] Finished at: Mon Jan 28 12:37:40 GMT 2013
[INFO] Final Memory: 20M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.2:site (default-site) on project foo: Error during page generation: Error while generating code. Invocation of method 'calculateLink' in  class org.codehaus.plexus.util.PathTool threw exception java.lang.NullPointerException at META-INF/maven/site.vm[line 62, column 44] -> [Help 1]
rlubke commented 11 years ago

Yep, I've hit this one as well.

andriusvelykis commented 10 years ago

Fixed in bf75c740a4629ee99f1d5b2d9635ea8c2730353c.

When no href attribute is set on a menu item, the link is disabled (Bootstrap's .disabled class) and not clickable.