diff --git a/hibernate-jfr/src/main/java/org/hibernate/event/jfr/internal/JfrEventManager.java b/hibernate-jfr/src/main/java/org/hibernate/event/jfr/internal/JfrEventManager.java index 50a74cde91..b2b786637e 100644 --- a/hibernate-jfr/src/main/java/org/hibernate/event/jfr/internal/JfrEventManager.java +++ b/hibernate-jfr/src/main/java/org/hibernate/event/jfr/internal/JfrEventManager.java @@ -452,7 +452,7 @@ public class JfrEventManager implements EventManager { public void completePartialFlushEvent( HibernateMonitoringEvent hibernateMonitoringEvent, AutoFlushEvent event) { - if ( event != null ) { + if ( event != null && hibernateMonitoringEvent != null) { final PartialFlushEvent flushEvent = (PartialFlushEvent) hibernateMonitoringEvent; flushEvent.end(); if ( flushEvent.shouldCommit() ) {