]> source.dussan.org Git - gitblit.git/commitdiff
Fix potential NPE in creating a date label
authorJames Moger <james.moger@gitblit.com>
Fri, 28 Feb 2014 23:00:18 +0000 (18:00 -0500)
committerJames Moger <james.moger@gitblit.com>
Sat, 1 Mar 2014 14:21:32 +0000 (09:21 -0500)
src/main/java/com/gitblit/wicket/WicketUtils.java

index f1f084c68ce4ba71db869a3acea5df19f180c074..bba3f79afbfe933f95f350456a4d4fa53799d667 100644 (file)
@@ -434,7 +434,7 @@ public class WicketUtils {
                parameterMap.put("pg", String.valueOf(pageNumber));\r
                return new PageParameters(parameterMap);\r
        }\r
-       \r
+\r
        public static PageParameters newBlameTypeParameter(String repositoryName,\r
                        String commitId, String path, String blameType) {\r
                Map<String, String> parameterMap = new HashMap<String, String>();\r
@@ -536,7 +536,7 @@ public class WicketUtils {
                        // past\r
                        title = timeUtils.timeAgo(date);\r
                }\r
-               if ((System.currentTimeMillis() - date.getTime()) < 10 * 24 * 60 * 60 * 1000L) {\r
+               if (title != null && (System.currentTimeMillis() - date.getTime()) < 10 * 24 * 60 * 60 * 1000L) {\r
                        String tmp = dateString;\r
                        dateString = title;\r
                        title = tmp;\r