[Ide] Fix infinite loop when opening cyclic file links.