HHH-15761 Avoid possible NullPointerException

In AbstractSqlAstTranslator
This commit is contained in:
Davide D'Alto 2022-12-13 17:07:14 +00:00 committed by Davide D'Alto
parent 20e7f1be9c
commit 919e322600
1 changed files with 2 additions and 2 deletions

View File

@ -1180,11 +1180,11 @@ public abstract class AbstractSqlAstTranslator<T extends JdbcOperation> implemen
// Since we get here, we know that no alias locks were applied.
// We only apply locking on the root query though if there is a global lock mode
final LockOptions lockOptions = getLockOptions();
final Boolean followOnLocking = getLockOptions() == null ? Boolean.FALSE : lockOptions.getFollowOnLocking();
final Boolean followOnLocking = lockOptions == null ? Boolean.FALSE : lockOptions.getFollowOnLocking();
if ( Boolean.TRUE.equals( followOnLocking ) ) {
this.lockOptions = null;
}
else if ( lockOptions.getLockMode() != LockMode.NONE ) {
else if ( lockOptions != null && lockOptions.getLockMode() != LockMode.NONE ) {
final ForUpdateClause forUpdateClause = new ForUpdateClause();
forUpdateClause.merge( getLockOptions() );
forUpdateClause.applyAliases( getDialect().getWriteRowLockStrategy(), querySpec );