mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
[view] fix: crashing when sorting packages
This commit is contained in:
@@ -99,7 +99,7 @@ def sort_packages(pkgs: Iterable[SoftwarePackage], word: str, limit: int = 0) ->
|
|||||||
res = []
|
res = []
|
||||||
for app_list in (exact, starts_with, contains, others):
|
for app_list in (exact, starts_with, contains, others):
|
||||||
if app_list:
|
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:
|
if last is not None and last <= 0:
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user