From 3efaaef240e6bc2405973c1b871554d91a985814 Mon Sep 17 00:00:00 2001 From: Bauke Scholtz Date: Sat, 14 Dec 2024 18:54:05 -0400 Subject: [PATCH] fix regression of https://github.com/eclipse-ee4j/mojarra/issues/5491 it caused `java.lang.NullPointerException: Cannot invoke "jakarta.faces.event.PhaseEvent.getPhaseId()" because "event" is null` when an empty project is deployed which has no phase listeners --- impl/src/main/java/com/sun/faces/lifecycle/Phase.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/impl/src/main/java/com/sun/faces/lifecycle/Phase.java b/impl/src/main/java/com/sun/faces/lifecycle/Phase.java index 7f273f9552..38a322831b 100644 --- a/impl/src/main/java/com/sun/faces/lifecycle/Phase.java +++ b/impl/src/main/java/com/sun/faces/lifecycle/Phase.java @@ -60,10 +60,7 @@ public abstract class Phase { public void doPhase(FacesContext context, Lifecycle lifecycle, ListIterator listeners) { context.setCurrentPhaseId(getId()); - PhaseEvent event = null; - if (listeners.hasNext()) { - event = new PhaseEvent(context, getId(), lifecycle); - } + PhaseEvent event = new PhaseEvent(context, getId(), lifecycle); // start timing - include before and after phase processing Timer timer = Timer.getInstance();