Check that parent is non-null and of correct type
@@ -78,7 +78,11 @@ public final class ApplicationContainer extends Container implements
@Override
public void getConfig(ZookeeperServerConfig.Builder builder) {
- ((ApplicationContainerCluster)parent).getConfig(builder);
+ AbstractConfigProducer<?> parent = getParent();
+ if (parent == null) return;
+
+ if (parent instanceof ApplicationContainerCluster)
+ ((ApplicationContainerCluster) this.parent).getConfig(builder);
builder.myid(index());
}
