From 46bdf9829d62a296c66c8a15969308838ea8cbe9 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Wed, 02 Jan 2013 16:19:06 -0500
Subject: [PATCH] Fixed NPE with web.allowForking && !git.cacheRepositoryList (issue-182)

---
 src/com/gitblit/GitBlit.java |    2 +-
 docs/04_releases.mkd         |   22 ++++++++++++++--------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/docs/04_releases.mkd b/docs/04_releases.mkd
index f8a89b7..a5bdb3e 100644
--- a/docs/04_releases.mkd
+++ b/docs/04_releases.mkd
@@ -1,14 +1,22 @@
 ## Release History
 
-<div class="alert alert-info">
-<h4>Update Note</h4>
-The permissions model has changed in this release.
-<p>If you are updating your server, you must also update any Gitblit Manager and Federation Client installs to 1.2.0 as well.  The data model used by the RPC mechanism has changed slightly for the new permissions infrastructure.</p>
-</div>
-
 ### Current Release
 
 **%VERSION%** ([go](http://code.google.com/p/gitblit/downloads/detail?name=%GO%) | [war](http://code.google.com/p/gitblit/downloads/detail?name=%WAR%) | [express](http://code.google.com/p/gitblit/downloads/detail?name=%EXPRESS%) | [fedclient](http://code.google.com/p/gitblit/downloads/detail?name=%FEDCLIENT%) | [manager](http://code.google.com/p/gitblit/downloads/detail?name=%MANAGER%) | [api](http://code.google.com/p/gitblit/downloads/detail?name=%API%)) based on [%JGIT%][jgit] &nbsp; *released %BUILDDATE%*
+
+#### fixes
+
+- Fixed nullpointer when using web.allowForking = true && git.cacheRepositoryList = false (issue 182)
+
+### Older Releases
+
+<div class="alert alert-info">
+<h4>Update Note</h4>
+The permissions model has changed in the 1.2.0 release.
+<p>If you are updating your server, you must also update any Gitblit Manager and Federation Client installs to 1.2.0 as well.  The data model used by the RPC mechanism has changed slightly for the new permissions infrastructure.</p>
+</div>
+
+**1.2.0** *released 2012-12-31*
 
 #### fixes
 
@@ -106,8 +114,6 @@
 - added Commons-Compress 1.4.1
 - added XZ for Java 1.0
 <hr/>
-
-### Older Releases
 
 <div class="alert alert-error">
 <h4>Update Note</h4>
diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java
index 076bb76..b497737 100644
--- a/src/com/gitblit/GitBlit.java
+++ b/src/com/gitblit/GitBlit.java
@@ -1739,7 +1739,7 @@
 			ProjectModel project = getProjectModel(userProject);
 			for (String repository : project.repositories) {
 				if (repository.startsWith(userProject)) {
-					RepositoryModel model = repositoryListCache.get(repository);
+					RepositoryModel model = getRepositoryModel(repository);
 					if (model.originRepository.equalsIgnoreCase(origin)) {
 						// user has a fork
 						return model.name;

--
Gitblit v1.9.1