Safeguard attachment links code.