Commit 7b529ef9 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Fix for NPE when nav item has no children.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9845 b35dd754-fafc-0310-a699-88a17e54d16e
parent 503387d2
...@@ -148,7 +148,6 @@ public class SubnavTag extends BodyTagSupport { ...@@ -148,7 +148,6 @@ public class SubnavTag extends BodyTagSupport {
subnav = current.getParent(); subnav = current.getParent();
} }
} }
Log.debug("\n\n\nXXXFFINDXXX\npageID = "+pageID+"\nsubPageID = "+subPageID+"\ncurrent = "+current+"\nsubcurrent = "+subcurrent+"\nsubnav = "+subnav+"\n\n\n");
Element currentTab = (Element)AdminConsole.getModel().selectSingleNode( Element currentTab = (Element)AdminConsole.getModel().selectSingleNode(
"//*[@id='" + pageID + "']/ancestor::tab"); "//*[@id='" + pageID + "']/ancestor::tab");
...@@ -160,6 +159,7 @@ public class SubnavTag extends BodyTagSupport { ...@@ -160,6 +159,7 @@ public class SubnavTag extends BodyTagSupport {
buf.append("<ul>"); buf.append("<ul>");
for (Object itemObj : items) { for (Object itemObj : items) {
Element item = (Element) itemObj; Element item = (Element) itemObj;
if (item.elements().size() > 0) {
Element firstSubItem = (Element)item.elements().get(0); Element firstSubItem = (Element)item.elements().get(0);
String pluginName = item.attributeValue("plugin"); String pluginName = item.attributeValue("plugin");
String subitemID = item.attributeValue("id"); String subitemID = item.attributeValue("id");
...@@ -183,6 +183,7 @@ public class SubnavTag extends BodyTagSupport { ...@@ -183,6 +183,7 @@ public class SubnavTag extends BodyTagSupport {
} }
buf.append("<li class=\"").append(css).append("\">").append(value).append("</li>"); buf.append("<li class=\"").append(css).append("\">").append(value).append("</li>");
} }
}
buf.append("</ul>"); buf.append("</ul>");
try { try {
out.write(buf.toString()); out.write(buf.toString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment