I like this, both the check to see if it exists, the check that it's the correct link, and even the "If we've gotten here" comment to explain why it's safe to do this.