Attempt to assign property "eventTypes" on null