Added missing non-null validation check on name field
Added non-null validation check on type field