add nullReference check (Exception appears if typed component does not exist)

"Exception appears if typed component does not exist" #618