diff --git a/report_builder/utils.py b/report_builder/utils.py index 4e590a83..7bdbc420 100644 --- a/report_builder/utils.py +++ b/report_builder/utils.py @@ -66,6 +66,8 @@ def sort_data(data_list, display_field): display_field - report_builder.DisplayField object returns sorted data_list """ + if not data_list: + return data_list position = display_field.position is_reverse = display_field.sort_reverse # Try to inspect sample data to determine type