From 8392dc753cb54e2c75c520950bc477da3e4669a4 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Mon, 14 Mar 2022 12:38:31 -0300 Subject: [PATCH] [view] fix: crashing when sorting packages --- bauh/view/qt/commons.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bauh/view/qt/commons.py b/bauh/view/qt/commons.py index aebc1cf5..8ba0a221 100644 --- a/bauh/view/qt/commons.py +++ b/bauh/view/qt/commons.py @@ -99,7 +99,7 @@ def sort_packages(pkgs: Iterable[SoftwarePackage], word: str, limit: int = 0) -> res = [] for app_list in (exact, starts_with, contains, others): if app_list: - last = limit - len(res) if limit > 0 else None + last = limit - len(res) if limit is not None and limit > 0 else None if last is not None and last <= 0: break