From 4fbd8ad290bf2ee9af64b97752d4e2dd082f47b6 Mon Sep 17 00:00:00 2001 From: Jeremy Grelle Date: Mon, 23 Mar 2009 17:41:06 +0000 Subject: [PATCH] SWF-1082 - SelectionTrackingActionListener throws NPE when component's parent is null --- .../faces/model/SelectionTrackingActionListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-faces/src/main/java/org/springframework/faces/model/SelectionTrackingActionListener.java b/spring-faces/src/main/java/org/springframework/faces/model/SelectionTrackingActionListener.java index 5ad4e686..211cee37 100644 --- a/spring-faces/src/main/java/org/springframework/faces/model/SelectionTrackingActionListener.java +++ b/spring-faces/src/main/java/org/springframework/faces/model/SelectionTrackingActionListener.java @@ -58,7 +58,7 @@ public class SelectionTrackingActionListener implements ActionListener { private void trackSelection(UIComponent component) { // Find parent component with a SelectionAware model if it exists UIComponent currentComponent = component; - while (!(currentComponent.getParent() instanceof UIViewRoot)) { + while (currentComponent.getParent() != null && !(currentComponent.getParent() instanceof UIViewRoot)) { UIComponent parent = currentComponent.getParent(); Method valueAccessor = ReflectionUtils.findMethod(parent.getClass(), "getValue"); if (valueAccessor != null) {