Fix a bug for empty file