Repository: wicket
Updated Branches:
  refs/heads/master 5c5490daf -> 3dd37b3fb


WICKET-5912 NPE in Page#hasInvisibleTransparentChild


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/3dd37b3f
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/3dd37b3f
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/3dd37b3f

Branch: refs/heads/master
Commit: 3dd37b3fb67a44cc44390848d18a96ebd3db220e
Parents: 5c5490d
Author: Andrea Del Bene <“[email protected]”>
Authored: Thu May 28 11:44:17 2015 +0200
Committer: Andrea Del Bene <“[email protected]”>
Committed: Thu May 28 11:44:17 2015 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/wicket/MarkupContainer.java    | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/3dd37b3f/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java 
b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java
index 6b0ddb1..c01b90e 100644
--- a/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java
+++ b/wicket-core/src/main/java/org/apache/wicket/MarkupContainer.java
@@ -727,8 +727,8 @@ public abstract class MarkupContainer extends Component 
implements Iterable<Comp
 
                if (child.getParent() != this)
                {
-                       // Add to map
-                       final Component replaced = put(child);
+                       // Get the child component to replace
+                       final Component replaced = children_get(child.getId());
 
                        // Look up to make sure it was already in the map
                        if (replaced == null)
@@ -737,7 +737,10 @@ public abstract class MarkupContainer extends Component 
implements Iterable<Comp
                                        exceptionMessage("Cannot replace a 
component which has not been added: id='" +
                                                child.getId() + "', component=" 
+ child));
                        }
-
+                       
+                       // Add to map
+                       put(child);
+                       
                        // first remove the component.
                        removedComponent(replaced);
 

Reply via email to