From 59072d8ff28885700ad8b80206eac993e4599cbe Mon Sep 17 00:00:00 2001 From: Kyler Eastridge Date: Fri, 1 Aug 2025 22:09:02 +0100 Subject: [PATCH] Fix crash when Powershell query for MUUID is empty --- src/update_manager.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/update_manager.py b/src/update_manager.py index 673814a..c501792 100644 --- a/src/update_manager.py +++ b/src/update_manager.py @@ -301,8 +301,14 @@ def make_VVM_UUID_hash(platform_key): #outputs row: #XXXXXXX-XXXX... # but splitlines() produces a whole lot of empty strings. - muuid = [line for line in muuid.splitlines() if line][-1].rstrip() - log.debug("result of subprocess call to get win MUUID: %r" % muuid) + muuid = [line for line in muuid.splitlines() if line] + if len(muuid) > 0: + muuid = muuid[-1].rstrip() + log.debug("result of subprocess call to get win MUUID: %r" % muuid) + else: + muuid = None + log.debug("pshell returned empty string when trying to get MUUID") + if muuid is None: #fake it