Qiu added null pointer check ofr link between switches