diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e90f874..0b595ad2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - calling pacman to read installed packages when "Repositories" and "AUR" properties are set to "false" (it would not display the packages, but the call was unnecessary being done) - not displaying installed AUR packages when AUR support is disabled - downloading AUR index during the initialization process when AUR support is disabled +- Flatpak + - crashing when trying to retrieve size of runtimes subcomponents [#164](https://github.com/vinifmor/bauh/issues/164) - UI - displaying a popup when information of a given package is not available diff --git a/bauh/gems/flatpak/flatpak.py b/bauh/gems/flatpak/flatpak.py index f5e61286..bf6de2c1 100755 --- a/bauh/gems/flatpak/flatpak.py +++ b/bauh/gems/flatpak/flatpak.py @@ -411,12 +411,15 @@ def map_update_download_size(app_ids: Iterable[str], installation: str, version: related_id = [appid for appid in app_ids if appid == line_id] - if related_id: - size = p2.findall(line_split[6])[0].split('?') + if related_id and len(line_split) >= 7: + size_tuple = p2.findall(line_split[6]) - if size and len(size) > 1: - try: - res[related_id[0].strip()] = size_to_byte(float(size[0]), size[1]) - except: - traceback.print_exc() + if size_tuple: + size = size_tuple[0].split('?') + + if size and len(size) > 1: + try: + res[related_id[0].strip()] = size_to_byte(float(size[0]), size[1]) + except: + traceback.print_exc() return res