Skip to content

Commit

Permalink
fix regression of #5491 it
Browse files Browse the repository at this point in the history
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
  • Loading branch information
BalusC committed Dec 14, 2024
1 parent 89d855b commit 3efaaef
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions impl/src/main/java/com/sun/faces/lifecycle/Phase.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ public abstract class Phase {
public void doPhase(FacesContext context, Lifecycle lifecycle, ListIterator<PhaseListener> 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();
Expand Down

0 comments on commit 3efaaef

Please sign in to comment.