Checking if selected item has a parent

This will avoid the inspector to open the folder itself.