diff --git a/lektor_groupby/util.py b/lektor_groupby/util.py index 2689ea7..1bdb5c5 100644 --- a/lektor_groupby/util.py +++ b/lektor_groupby/util.py @@ -16,7 +16,7 @@ def report_config_error(key: str, field: str, val: str, e: Exception) -> None: def most_used_key(keys: List[str]) -> str: ''' Find string with most occurrences. ''' if len(keys) < 3: - return keys[0] # TODO: first vs last occurrence + return keys[0] if keys else '' # TODO: first vs last occurrence best_count = 0 best_key = '' tmp = {} # type: Dict[str, int]