From 7faae967ca17b43596fab5446379d11c41450355 Mon Sep 17 00:00:00 2001 From: Brett Meyer Date: Wed, 2 Oct 2013 10:01:29 -0400 Subject: [PATCH] HHH-6576 NPE in Ehcache HibernateEhcacheUtils --- .../cache/ehcache/internal/util/HibernateEhcacheUtils.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hibernate-ehcache/src/main/java/org/hibernate/cache/ehcache/internal/util/HibernateEhcacheUtils.java b/hibernate-ehcache/src/main/java/org/hibernate/cache/ehcache/internal/util/HibernateEhcacheUtils.java index 6167af991e..c3187cbbb5 100644 --- a/hibernate-ehcache/src/main/java/org/hibernate/cache/ehcache/internal/util/HibernateEhcacheUtils.java +++ b/hibernate-ehcache/src/main/java/org/hibernate/cache/ehcache/internal/util/HibernateEhcacheUtils.java @@ -68,6 +68,12 @@ public final class HibernateEhcacheUtils { */ public static Configuration loadAndCorrectConfiguration(URL url) { final Configuration config = ConfigurationFactory.parseConfiguration( url ); + + // EHC-875 / HHH-6576 + if ( config == null ) { + return null; + } + if ( config.getDefaultCacheConfiguration().isTerracottaClustered() ) { if ( ValueMode.IDENTITY .equals( config.getDefaultCacheConfiguration().getTerracottaConfiguration().getValueMode() ) ) {