]> source.dussan.org Git - gitblit.git/commitdiff
Fixed null pointer in object cache
authorJames Moger <james.moger@gitblit.com>
Sat, 22 Oct 2011 13:23:10 +0000 (09:23 -0400)
committerJames Moger <james.moger@gitblit.com>
Sat, 22 Oct 2011 13:23:10 +0000 (09:23 -0400)
src/com/gitblit/models/ObjectCache.java

index 48ede90e8936e2634be42b32f50bfb80574271f4..57494fbce7450eb8f51e445081f1e91970bedb8c 100644 (file)
@@ -80,6 +80,9 @@ public class ObjectCache<X> implements Serializable {
        }\r
 \r
        public Object remove(String name) {\r
-               return cache.remove(name).object;\r
+               if (cache.containsKey(name)) {\r
+                       return cache.remove(name).object;\r
+               }\r
+               return null;\r
        }\r
 }\r