added missing checks form nullptr
Eradicated ComponentType enum.