From 063ce2d4757ad2e5eabd72ee83c55e3402954e3d Mon Sep 17 00:00:00 2001 From: Mohit Jeswani Date: Wed, 19 Aug 2026 20:02:40 +0000 Subject: [PATCH] fix(pkg_auto): guard against IndexError on empty free_form_lines in get_batches() Signed-off-by: Mohit Jeswani --- pkg_auto/impl/sort_packages_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg_auto/impl/sort_packages_list.py b/pkg_auto/impl/sort_packages_list.py index 909cd0b6ff4..9486bbff97e 100755 --- a/pkg_auto/impl/sort_packages_list.py +++ b/pkg_auto/impl/sort_packages_list.py @@ -106,7 +106,7 @@ def get_batches(self): pkg_lines += [line] else: if pkg_lines: - while not free_form_lines[-1]: + while free_form_lines and not free_form_lines[-1]: free_form_lines = free_form_lines[:-1] batches += [Reader.CommentBatch(free_form_lines, pkg_lines)] free_form_lines = []