addLink throws en exception when the route doesn't exist

Instead of getting a **PHP Fatal error:  Call to a member function getMethods() on a non-object in RestHalBundle/ApiResource/Resource.php on line 28**