#246 fix TypeError: Cannot read property 'length' of undefined when trying to add custom fields to content type