Sanity check: ensure selected link isn't null before manipulating it
Working implementation of inline link expansion