Fixed null pointer exception when path==null