From fd7ada315e1a0e8cb58c423aa46510c51c169e81 Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Fri, 29 Apr 2016 17:44:00 -0500 Subject: [PATCH] Fixed NullPointerException when building session. --- .../org/hibernate/internal/SessionFactoryImpl.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java index 7a9f93c364..be90537b86 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionFactoryImpl.java @@ -553,11 +553,13 @@ public final class SessionFactoryImpl implements SessionFactoryImplementor { } final Session session = builder.openSession(); - map.keySet().forEach ( key -> { - if ( key instanceof String ) { - session.setProperty( (String) key, map.get( key ) ); - } - }); + if ( map != null ) { + map.keySet().forEach( key -> { + if ( key instanceof String ) { + session.setProperty( (String) key, map.get( key ) ); + } + } ); + } return session; }