added null checks + fixed issue w.r.t creation of Component
3 files changed