check file name not none before checking existence