fix npe in file constructor