Fixed dialogue crash

it's not the most elegant of solutions but it does the job
Merge branch 'Project-folder' of https://github.com/Pingli/PjBackToBasics into Project-folder