Changeset 1338


Ignore:
Timestamp:
05/18/11 15:20:41 (13 years ago)
Author:
twagoo
Message:

ComponentSpecExpander?: deal with unresolved component id's

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/CMDComponentSpecExpander.java

    r1335 r1338  
    2828                // Use uncached components and profiles, because we expand and thus change them this change should not be in the cache.
    2929                CMDComponentSpec spec = getUncachedComponent(componentId);
    30                 CMDComponentType nested = getComponentTypeOfAComponent(spec);
    31                 expandNestedComponent(nested.getCMDComponent());
    32                 overwriteAttributes(cmdComponentType, nested);
    33                 expanded.add(nested);
     30                if (spec != null) {
     31                    CMDComponentType nested = getComponentTypeOfAComponent(spec);
     32                    expandNestedComponent(nested.getCMDComponent());
     33                    overwriteAttributes(cmdComponentType, nested);
     34                    expanded.add(nested);
     35                } else {
     36                    // Spec could not be resolved
     37                    LOG.warn("Could not resolve referenced component with id " + componentId);
     38                    // Add spec itself, without futher expanding
     39                    expanded.add(cmdComponentType);
     40                }
    3441            } else {
     42                // No id = embedded component
    3543                expandNestedComponent(cmdComponentType.getCMDComponent());
    3644                expanded.add(cmdComponentType);//no attributes overwritten
Note: See TracChangeset for help on using the changeset viewer.