Avoided null pointer dereferencing for link