bugfix for nullpointer exception
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/5a0ba66f Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/5a0ba66f Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/5a0ba66f Branch: refs/heads/MARMOTTA-228 Commit: 5a0ba66fc784dd4f71efe5673a1ce61dbf3d7eff Parents: f83e310 Author: tkurz <[email protected]> Authored: Thu May 16 12:29:58 2013 +0200 Committer: tkurz <[email protected]> Committed: Thu May 16 12:29:58 2013 +0200 ---------------------------------------------------------------------- .../core/services/modules/ModuleServiceImpl.java | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/5a0ba66f/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/modules/ModuleServiceImpl.java ---------------------------------------------------------------------- diff --git a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/modules/ModuleServiceImpl.java b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/modules/ModuleServiceImpl.java index 40df1c4..a3cfb15 100644 --- a/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/modules/ModuleServiceImpl.java +++ b/platform/marmotta-core/src/main/java/org/apache/marmotta/platform/core/services/modules/ModuleServiceImpl.java @@ -399,7 +399,12 @@ public class ModuleServiceImpl implements ModuleService { for(String path : config.getStringArray("adminpages")) { HashMap<String,String> map = new HashMap<String, String>(); map.put("link",config.getString("baseurl")+path); - map.put("title",path.substring(path.lastIndexOf("/")+1,path.lastIndexOf(".")).replaceAll("_"," ")); + String title; + if(path.lastIndexOf(".") > path.lastIndexOf("/")+1) + title = path.substring(path.lastIndexOf("/")+1,path.lastIndexOf(".")).replaceAll("_"," "); + else + title = path.substring(path.lastIndexOf("/")+1); + map.put("title",title); l.add(map); } }
