From: James Moger Date: Sat, 22 Oct 2011 13:23:10 +0000 (-0400) Subject: Fixed null pointer in object cache X-Git-Tag: v0.7.0~59 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4a286829631bd6e69f670ff1ef3e1f22d570b940;p=gitblit.git Fixed null pointer in object cache --- diff --git a/src/com/gitblit/models/ObjectCache.java b/src/com/gitblit/models/ObjectCache.java index 48ede90e..57494fbc 100644 --- a/src/com/gitblit/models/ObjectCache.java +++ b/src/com/gitblit/models/ObjectCache.java @@ -80,6 +80,9 @@ public class ObjectCache implements Serializable { } public Object remove(String name) { - return cache.remove(name).object; + if (cache.containsKey(name)) { + return cache.remove(name).object; + } + return null; } }