You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by tk...@apache.org on 2013/05/16 12:31:44 UTC

[14/14] git commit: bugfix for nullpointer exception

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 <tk...@apache.org>
Authored: Thu May 16 12:29:58 2013 +0200
Committer: tkurz <tk...@apache.org>
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);
                 }
             }