Avoid crash if trying to open a non-existent file

which currently might occur by clicking in the history entry of a file which was removed
Merge pull request #458 from thotypous/master

Avoid crash if trying to open a non-existent file