summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-09-23 09:52:10 -0400
committerJames Moger <james.moger@gitblit.com>2013-09-23 09:52:10 -0400
commit36491b1c8bb52262fbf276e3a1f5951fde5c091d (patch)
treeeaea8bea8e644f211c86c2635a2861c548f6dd4a /src/main
parent288d6cc169706607601f185505fca50f9950c30b (diff)
downloadgitblit-36491b1c8bb52262fbf276e3a1f5951fde5c091d.tar.gz
gitblit-36491b1c8bb52262fbf276e3a1f5951fde5c091d.zip
Fix potential NPE in git commit search
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/gitblit/utils/JGitUtils.java5
1 files changed, 4 insertions, 1 deletions
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<RevCommit> searchRevlogs(Repository repository, String objectId,
String value, final com.gitblit.Constants.SearchType type, int offset, int maxCount) {
- final String lcValue = value.toLowerCase();
List<RevCommit> list = new ArrayList<RevCommit>();
+ 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;