Fixed possible NullPointerException during link-calculation