Changeset 30232

Show
Ignore:
Timestamp:
02/18/08 16:13:28 (9 months ago)
Author:
dmihalache
Message:

additional check for docType existence

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-ui-web/src/main/java/org/nuxeo/ecm/platform/ui/web/tag/fn/DocumentModelFunctions.java

    r28926 r30232  
    111111    } 
    112112 
    113     private static String getDefaultView(DocumentModel doc)
     113    private static String getDefaultView(DocumentModel doc) throws ClientException
    114114        String docType = doc.getType(); 
    115115 
     
    117117            return defaultViewCache.get(docType); 
    118118        } else { 
    119             String defaultView = getTypeManager().getType(docType).getDefaultView(); 
     119            org.nuxeo.ecm.platform.types.Type type = getTypeManager().getType(docType); 
     120            if (type == null) { 
     121                throw new ClientException("Cannot get default view. Type '" 
     122                        + docType + "' not registered"); 
     123            } 
     124            String defaultView = type.getDefaultView(); 
    120125            defaultViewCache.put(docType, defaultView); 
    121126            return defaultView;