1. opensymphony
  2. oscache

Commits

chri...@81dbac14-341a-0410-aa85-cbcd92e6f43e  committed bf57818

[CACHE-63] Avoid a possible NPE

  • Participants
  • Parent commits 8e97380
  • Branches default

Comments (0)

Files changed (1)

File src/core/java/com/opensymphony/oscache/base/AbstractCacheAdministrator.java

View file
  • Ignore whitespace
      * be caught and logged.
      */
     protected void finalizeListeners(Cache cache) {
+        // It's possible for cache to be null if getCache() was never called (CACHE-63)
+        if (cache == null) {
+            return;
+        }
+
         Object[] listeners = cache.listenerList.getListenerList();
 
         for (int i = listeners.length - 2; i >= 0; i -= 2) {