From 36491b1c8bb52262fbf276e3a1f5951fde5c091d Mon Sep 17 00:00:00 2001 From: James Moger Date: Mon, 23 Sep 2013 09:52:10 -0400 Subject: Fix potential NPE in git commit search --- src/main/java/com/gitblit/utils/JGitUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/com/gitblit/utils/JGitUtils.java b/src/main/java/com/gitblit/utils/JGitUtils.java index cf6ec26d..3c1173ce 100644 --- a/src/main/java/com/gitblit/utils/JGitUtils.java +++ b/src/main/java/com/gitblit/utils/JGitUtils.java @@ -1342,14 +1342,17 @@ public class JGitUtils { */ public static List searchRevlogs(Repository repository, String objectId, String value, final com.gitblit.Constants.SearchType type, int offset, int maxCount) { - final String lcValue = value.toLowerCase(); List list = new ArrayList(); + if (StringUtils.isEmpty(value)) { + return list; + } if (maxCount == 0) { return list; } if (!hasCommits(repository)) { return list; } + final String lcValue = value.toLowerCase(); try { // resolve branch ObjectId branchObject; -- cgit v1.2.3