add nullReference check

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