diff --git a/src/main/java/org/richfaces/component/UIFocus.java b/src/main/java/org/richfaces/component/UIFocus.java index 5831592..b2d76c3 100644 --- a/src/main/java/org/richfaces/component/UIFocus.java +++ b/src/main/java/org/richfaces/component/UIFocus.java @@ -5,11 +5,7 @@ import javax.faces.component.UIComponentBase; import javax.faces.component.UIForm; import javax.faces.component.UIInput; import javax.faces.context.FacesContext; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; +import java.util.*; public abstract class UIFocus extends UIComponentBase { // ------------------------------ FIELDS ------------------------------ @@ -80,7 +76,10 @@ public abstract class UIFocus extends UIComponentBase { Set allowedClientIds = new HashSet(); Iterator clientIdsWithMessages = getFacesContext().getClientIdsWithMessages(); while (clientIdsWithMessages.hasNext()) { - allowedClientIds.add(clientIdsWithMessages.next()); + final String clientId = clientIdsWithMessages.next(); + if (clientId != null) { + allowedClientIds.add(clientId); + } } final List inputs = new ArrayList(); getInputs(getParentForm(this), allowedClientIds, inputs);