diff --git a/CHANGELOG.md b/CHANGELOG.md index b45ca27f..203ee21d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - downgrade: pre-downloading sources from the latest version instead of the older - Flatpak: - displaying "No Internet connection" when an error happens during commits reading within the downgrade process + - an exception happens when trying to retrieve the information from partials in Flatpak 1.4 - UI: - **About** window icons scaling - Toolbar buttons get hidden [#5](https://github.com/vinifmor/bauh/issues/5) diff --git a/bauh/gems/flatpak/flatpak.py b/bauh/gems/flatpak/flatpak.py index 797c6b7b..d9645d2d 100755 --- a/bauh/gems/flatpak/flatpak.py +++ b/bauh/gems/flatpak/flatpak.py @@ -11,7 +11,12 @@ RE_SEVERAL_SPACES = re.compile(r'\s+') def get_app_info_fields(app_id: str, branch: str, installation: str, fields: List[str] = [], check_runtime: bool = False): - info = re.findall(r'\w+:\s.+', get_app_info(app_id, branch, installation)) + info = get_app_info(app_id, branch, installation) + + if not info: + return {} + + info = re.findall(r'\w+:\s.+', info) data = {} fields_to_retrieve = len(fields) + (1 if check_runtime and 'ref' not in fields else 0) @@ -62,7 +67,11 @@ def get_version(): def get_app_info(app_id: str, branch: str, installation: str): - return run_cmd('{} info {} {}'.format('flatpak', app_id, branch, '--{}'.format(installation))) + try: + return run_cmd('{} info {} {}'.format('flatpak', app_id, branch, '--{}'.format(installation))) + except: + traceback.print_exc() + return '' def get_commit(app_id: str, branch: str, installation: str) -> str: