Fix crashes when double-clicking folder in tree

Editor was throwing an exception whenever you double-clicked a folder
node to expand it as it was attempting to load the folder as a file