Avoided null pointer on files without an extension