fix a potential source of NPEs

(though this code path isn't working anyway for other reasons)
This commit is contained in:
Gavin 2022-12-03 08:53:08 +01:00 committed by Gavin King
parent 6596389e55
commit 85bfed78c3
1 changed files with 24 additions and 23 deletions

View File

@ -79,30 +79,31 @@ public class JdbcValueBindingsImpl implements JdbcValueBindings {
SharedSessionContractImplementor session) {
final BindingGroup bindingGroup = bindingGroupMap.get( statementDetails.getMutatingTableDetails().getTableName() );
if ( bindingGroup == null ) {
return;
statementDetails.resolveStatement();
}
else {
bindingGroup.forEachBinding( (binding) -> {
try {
binding.getValueBinder().bind(
statementDetails.resolveStatement(),
binding.getValue(),
binding.getPosition(),
session
);
}
catch (SQLException e) {
throw session.getJdbcServices().getSqlExceptionHelper().convert(
e,
String.format(
Locale.ROOT,
"Unable to bind parameter #%s - %s",
binding.getPosition(),
binding.getValue()
)
);
}
} );
}
bindingGroup.forEachBinding( (binding) -> {
try {
binding.getValueBinder().bind(
statementDetails.resolveStatement(),
binding.getValue(),
binding.getPosition(),
session
);
}
catch (SQLException e) {
throw session.getJdbcServices().getSqlExceptionHelper().convert(
e,
String.format(
Locale.ROOT,
"Unable to bind parameter #%s - %s",
binding.getPosition(),
binding.getValue()
)
);
}
} );
}
@Override