diff --git a/CHANGELOG.md b/CHANGELOG.md index 71581e15..1aa1f40b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Improvements - General - preventing command injection through the search mechanism [#266](https://github.com/vinifmor/bauh/issues/266) + - code refactoring - UI - manage window minimum width related to the table columns diff --git a/bauh/gems/flatpak/flatpak.py b/bauh/gems/flatpak/flatpak.py index 87ac1424..a8336bd7 100755 --- a/bauh/gems/flatpak/flatpak.py +++ b/bauh/gems/flatpak/flatpak.py @@ -326,15 +326,18 @@ def get_app_commits_data(app_ref: str, origin: str, installation: str, full_str: return commits -def search(version: Version, word: str, installation: str, app_id: bool = False) -> List[dict]: +def search(version: Version, word: str, installation: str, app_id: bool = False) -> Optional[List[dict]]: res = run_cmd(f'flatpak search {word} --{installation}', lang=None) - found = [] + if not res: + return + found = None split_res = res.strip().split('\n') if split_res and '\t' in split_res[0]: + found = [] for info in split_res: if info: info_list = info.split('\t')