From 307be4549b0a2d2fa07c7c08d46d37e843e5a056 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 10 Sep 2025 06:33:46 +0000 Subject: [PATCH] Fix vault caching count and NoneType iteration issues - Fix 'NoneType' object is not iterable error in decrypt_labs_remote_cdm - Fix vault count display showing 0/3 instead of actual successful vault count --- unshackle/core/cdm/decrypt_labs_remote_cdm.py | 5 +++-- unshackle/core/vaults.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/unshackle/core/cdm/decrypt_labs_remote_cdm.py b/unshackle/core/cdm/decrypt_labs_remote_cdm.py index c09f275..8645b4e 100644 --- a/unshackle/core/cdm/decrypt_labs_remote_cdm.py +++ b/unshackle/core/cdm/decrypt_labs_remote_cdm.py @@ -625,8 +625,9 @@ class DecryptLabsRemoteCDM: if "cached_keys" in session: cached_keys = session.get("cached_keys", []) - for cached_key in cached_keys: - all_keys.append(cached_key) + if cached_keys: + for cached_key in cached_keys: + all_keys.append(cached_key) for license_key in license_keys: already_exists = False diff --git a/unshackle/core/vaults.py b/unshackle/core/vaults.py index d4e9408..1c50f71 100644 --- a/unshackle/core/vaults.py +++ b/unshackle/core/vaults.py @@ -74,7 +74,9 @@ class Vaults: for vault in self.vaults: if not vault.no_push: try: - success += bool(vault.add_keys(self.service, kid_keys)) + # Count each vault that successfully processes the keys (whether new or existing) + vault.add_keys(self.service, kid_keys) + success += 1 except (PermissionError, NotImplementedError): pass return success