Don't open directories as if they were files

Fixes crash when selecting a folder in the level selector on Linux.