If a list contains a node which is not a field (e.g. a button), it will not be found in the fields so we'll have an error trying to get 'type' from undefined.