fix NPE caused by null filePath