Commit 58648dff authored by Dumoulin Nicolas's avatar Dumoulin Nicolas
Browse files

bugfix: npe

parent 727b5b23
......@@ -18,13 +18,15 @@ public class CollectionIntrospector {
protected static OhObjectComplex introspect(OhObjectCollection objectCollection, OhOuiContext ohOui, FieldFilter... fieldFilters) throws IntrospectionException {
objectCollection.setDeclaredItemClass(getItemClass(objectCollection.getGenericType()));
int i = 0;
for (Object element : objectCollection.getValue()) {
// invoke introspection on each element
Type subCollectionGenericType = null;
if (Collection.class.isAssignableFrom(element.getClass())) {
subCollectionGenericType = getItemClass(objectCollection.getDeclaredItemClass());
if (objectCollection.getValue() != null) {
for (Object element : objectCollection.getValue()) {
// invoke introspection on each element
Type subCollectionGenericType = null;
if (Collection.class.isAssignableFrom(element.getClass())) {
subCollectionGenericType = getItemClass(objectCollection.getDeclaredItemClass());
}
objectCollection.addChild(DefaultObjectIntrospector.introspectChild(ohOui, objectCollection.getDeclaredItemClass(), "" + i++, element, subCollectionGenericType, fieldFilters));
}
objectCollection.addChild(DefaultObjectIntrospector.introspectChild(ohOui, objectCollection.getDeclaredItemClass(), "" + i++, element, subCollectionGenericType, fieldFilters));
}
return objectCollection;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment