From 934a586b938994de570cae8b512bc9c8aacb4345 Mon Sep 17 00:00:00 2001 From: Logan Cary Date: Wed, 3 Jul 2024 11:38:59 -0400 Subject: [PATCH] catch `JSONDecodeError` --- src/middlewared/middlewared/plugins/system/vendor/vendor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/middlewared/middlewared/plugins/system/vendor/vendor.py b/src/middlewared/middlewared/plugins/system/vendor/vendor.py index 654bd34c258c3..ddb4856be7f71 100644 --- a/src/middlewared/middlewared/plugins/system/vendor/vendor.py +++ b/src/middlewared/middlewared/plugins/system/vendor/vendor.py @@ -17,7 +17,7 @@ def name(self) -> str | None: with open(SENTINEL_FILE_PATH, 'r') as file: if contents := file.read(): return json.loads(contents).get('name') - except FileNotFoundError: + except (FileNotFoundError, json.JSONDecodeError): return None @api_method(UnvendorArgs, UnvendorResult, private=True)