If the link is marked deleted, the nodes would have been cleared. So, there can
be cases where the link will not have any nodes i.e. we should check if the
link has valid pointers to nodes or not before accessing the nodes.

Change-Id: I4ac540dbdd8e04cdbf2c37fd311e64de82c69bfe