null check for entity in event dispatch