django-commons / drf-excel

An XLSX spreadsheet renderer for Django REST Framework.
BSD 3-Clause "New" or "Revised" License
217 stars 40 forks source link

Fix IndexError on empty Iterable fields #16

Closed davish closed 4 years ago

davish commented 4 years ago

The XLSXRenderer is referencing v[0] before checking if v[0] exists. The PR adds a length check to avoid an IndexError when empty arrays are the value of a field after serialization.

FlipperPA commented 4 years ago

Looks good to me, thanks!