From 0a73abb640c9b92d55c5589260bd6c1f7e8b6d51 Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 5 Sep 2014 12:07:37 -0400 Subject: [PATCH] Fix NPE in raw servlet for long project names --- src/main/java/com/gitblit/servlet/RawServlet.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/com/gitblit/servlet/RawServlet.java b/src/main/java/com/gitblit/servlet/RawServlet.java index 7504b4be..9fb96a5d 100644 --- a/src/main/java/com/gitblit/servlet/RawServlet.java +++ b/src/main/java/com/gitblit/servlet/RawServlet.java @@ -172,10 +172,7 @@ public class RawServlet extends DaggerServlet { } else { repository = path.substring(0, slash); } - offset += slash; - if (offset == 0) { - offset++; - } + offset += ( slash + 1 ); r = repositoryManager.getRepository(repository, false); if (repository.equals(path)) { // either only repository in url or no repository found -- 2.39.5