return when file is null or stream