From d7858136701c495ed4f607cbdd61b0dfedbe3835 Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Thu, 13 Jun 2024 17:47:02 -0400 Subject: [PATCH] flatpaks: Prevent useless warning in _get_addon_refs_for_pkginfo(). --- .../dist-packages/mintcommon/installer/_flatpak.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/usr/lib/python3/dist-packages/mintcommon/installer/_flatpak.py b/usr/lib/python3/dist-packages/mintcommon/installer/_flatpak.py index 84b8c36..7f1dba2 100644 --- a/usr/lib/python3/dist-packages/mintcommon/installer/_flatpak.py +++ b/usr/lib/python3/dist-packages/mintcommon/installer/_flatpak.py @@ -506,12 +506,14 @@ def _get_addon_refs_for_pkginfo(parent_pkginfo): try: aspool = pools[parent_pkginfo.remote] ascomp = aspool.lookup_component(parent_pkginfo, resolve_addons=True) - addons = ascomp.get_addons() - for addon in addons: - info = create_pkginfo_from_as_component(addon, parent_pkginfo.remote, parent_pkginfo.remote_url) - if info: - addon_refs.append(info.refid) + if ascomp is not None: + addons = ascomp.get_addons() + + for addon in addons: + info = create_pkginfo_from_as_component(addon, parent_pkginfo.remote, parent_pkginfo.remote_url) + if info: + addon_refs.append(info.refid) except Exception as e: debug(str(e))