Commit e0435512 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Small fixes.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1169 b35dd754-fafc-0310-a699-88a17e54d16e
parent 4e97870f
...@@ -44,7 +44,7 @@ public class AdminConsole { ...@@ -44,7 +44,7 @@ public class AdminConsole {
} }
private static void init() { private static void init() {
overrideModels = new HashMap<String,Element>(); overrideModels = new LinkedHashMap<String,Element>();
load(); load();
} }
...@@ -273,8 +273,11 @@ public class AdminConsole { ...@@ -273,8 +273,11 @@ public class AdminConsole {
// Make sure that the URL on the tab is set. If not, default to the // Make sure that the URL on the tab is set. If not, default to the
// url of the first item. // url of the first item.
if (tab.attributeValue("url") == null) { if (tab.attributeValue("url") == null) {
tab.addAttribute("url", ((Element)tab.selectSingleNode( Element firstItem = (Element)tab.selectSingleNode(
"//item[@url]")).attributeValue("url")); "//item[@url]");
if (firstItem != null) {
tab.addAttribute("url", firstItem.attributeValue("url"));
}
} }
generatedModel.add(tab.createCopy()); generatedModel.add(tab.createCopy());
} }
...@@ -331,7 +334,7 @@ public class AdminConsole { ...@@ -331,7 +334,7 @@ public class AdminConsole {
if (existingEntry == null) { if (existingEntry == null) {
sidebar.add(entry.createCopy()); sidebar.add(entry.createCopy());
} }
// More complex case -- a sidebar with the same id already exists. // More complex case -- an entry with the same id already exists.
// In this case, we have to overrite only the difference between // In this case, we have to overrite only the difference between
// the two elements. // the two elements.
else { else {
......
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