nfrankel / conf-automation

Home Page:https://blog.frankel.ch/automating-conference-submission-workflow/1/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug] Account for empty rows when updating the sheet

nfrankel opened this issue · comments

    class Result(values: Collection<Any>) {
        private val majorDimension: String
        private val range: String
        private val rows: List<ResultRow>

        init {
            val wrapper: List<Any> = ArrayList(values)
            majorDimension = wrapper[0] as String
            range = wrapper[1] as String
            rows = (wrapper[2] as List<List<Any>>)
                .mapIndexed { index, values -> ResultRow(index + 3, values) }
        }

In the above code, rows can contain empty arrays if there data rows are non-contiguous.

I should filter them out to avoid unwanted bug.

Breaks the code