Fix #350 test if no file before indexing