From 4a286829631bd6e69f670ff1ef3e1f22d570b940 Mon Sep 17 00:00:00 2001 From: James Moger Date: Sat, 22 Oct 2011 09:23:10 -0400 Subject: [PATCH] Fixed null pointer in object cache --- src/com/gitblit/models/ObjectCache.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } } -- 2.39.5