Minor fix to avoid ArgumentOutOfRangeException

When the file is empty, data[0] would throw and swallow the original exception.