Added exception clause in tree view popup menu

If an externally-linked file does not exist, the check for its rank
would trigger an exception. The exception is now caught.