NPE in org.hibernate.jpa.internal.util.PersistenceUtilHelper.isInitialized(PersistentAttributeInterceptable)

Description

Depending upon how bytecode enhancement is set up, PersistentAttributeInterceptable.$$_hibernate_getInterceptor() may return null.
I noticed this happens with this configuration of the maven enhancer:

The problem is at https://github.com/hibernate/hibernate-orm/blob/5.2.5/hibernate-core/src/main/java/org/hibernate/jpa/internal/util/PersistenceUtilHelper.java#L97 - the fix is to just add a null check. Here's a pull request:
https://github.com/hibernate/hibernate-orm/pull/1660

Environment

None

Status

Assignee

Unassigned

Reporter

Craig Andrews

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Affects versions

Priority

Major
Configure