HHH-4843 guard against null properties

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18631 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Emmanuel Bernard 2010-01-26 17:11:04 +00:00
parent 82c5616343
commit 8386be117a
1 changed files with 6 additions and 4 deletions

View File

@ -90,11 +90,13 @@ public final class LogHelper {
sb.append( "]\n\t" ); sb.append( "]\n\t" );
sb.append( "Properties [" ); sb.append( "Properties [" );
Properties properties = unitInfo.getProperties(); Properties properties = unitInfo.getProperties();
if (properties != null) {
Enumeration names = properties.propertyNames(); Enumeration names = properties.propertyNames();
while ( names.hasMoreElements() ) { while ( names.hasMoreElements() ) {
String name = (String) names.nextElement(); String name = (String) names.nextElement();
sb.append( "\n\t\t" ).append( name ).append( ": " ).append( properties.getProperty( name ) ); sb.append( "\n\t\t" ).append( name ).append( ": " ).append( properties.getProperty( name ) );
} }
}
sb.append( "]" ); sb.append( "]" );
return sb.toString(); return sb.toString();
} }