brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [1/2] incubator-brooklyn git commit: Fix NPE in removeMember
Date Thu, 19 Mar 2015 17:24:33 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 2a18a79c7 -> b0eff1ac5


Fix NPE in removeMember


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/c6e1bf3f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/c6e1bf3f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/c6e1bf3f

Branch: refs/heads/master
Commit: c6e1bf3ffd0d682e760daef6d7d653221edcc0a7
Parents: 2a18a79
Author: Andrew Kennedy <grkvlt@apache.org>
Authored: Thu Mar 19 17:18:05 2015 +0000
Committer: Andrew Kennedy <grkvlt@apache.org>
Committed: Thu Mar 19 17:18:50 2015 +0000

----------------------------------------------------------------------
 .../src/main/java/brooklyn/entity/basic/AbstractGroupImpl.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c6e1bf3f/core/src/main/java/brooklyn/entity/basic/AbstractGroupImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/entity/basic/AbstractGroupImpl.java b/core/src/main/java/brooklyn/entity/basic/AbstractGroupImpl.java
index 1b40603..14ccd25 100644
--- a/core/src/main/java/brooklyn/entity/basic/AbstractGroupImpl.java
+++ b/core/src/main/java/brooklyn/entity/basic/AbstractGroupImpl.java
@@ -189,14 +189,16 @@ public abstract class AbstractGroupImpl extends AbstractEntity implements
Abstra
                     Optional<Entity> result = Iterables.tryFind(getChildren(), new
Predicate<Entity>() {
                         @Override
                         public boolean apply(Entity input) {
-                            return input.getConfig(DelegateEntity.DELEGATE_ENTITY).equals(member);
+                            Entity delegate = input.getConfig(DelegateEntity.DELEGATE_ENTITY);
+                            if (delegate == null) return false;
+                            return delegate.equals(member);
                         }
                     });
                     if (result.isPresent()) {
                         Entity child = result.get();
                         removeChild(child);
                         Entities.unmanage(child);
-                       }
+                    }
                 }
 
                 getManagementSupport().getEntityChangeListener().onMembersChanged();


Mime
View raw message