adding a null check for the schema file to help diagnose a stacktrace in create web content.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5616 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2007-05-03 23:27:42 +00:00
parent 85ef9488da
commit ca496b0c86

View File

@@ -203,6 +203,13 @@ public class FormImpl
final NodeService nodeService = this.getServiceRegistry().getNodeService();
final NodeRef schemaNodeRef = (NodeRef)
nodeService.getProperty(folderNodeRef, WCMAppModel.PROP_XML_SCHEMA);
if (schemaNodeRef == null)
{
throw new NullPointerException("expected property " + WCMAppModel.PROP_XML_SCHEMA +
" of " + folderNodeRef +
" for form " + this.getName() +
" not to be null.");
}
return XMLUtil.parse(schemaNodeRef,
this.getServiceRegistry().getContentService());
}