fix NPE

when file does not exists.
fix NPE