From 576bd29fa120ba4e37b68178fafbc73e2c74908a Mon Sep 17 00:00:00 2001 From: nlscc <66028747+nlscc@users.noreply.github.com> Date: Tue, 22 Feb 2022 01:05:18 +0000 Subject: check for missing filename (#54) --- samloader/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/samloader/main.py b/samloader/main.py index 48c9a82..eba0dc0 100644 --- a/samloader/main.py +++ b/samloader/main.py @@ -88,7 +88,9 @@ def getbinaryfile(client, fw, model, region): status = int(root.find("./FUSBody/Results/Status").text) if status != 200: raise Exception("DownloadBinaryInform returned {}, firmware could not be found?".format(status)) - size = int(root.find("./FUSBody/Put/BINARY_BYTE_SIZE/Data").text) filename = root.find("./FUSBody/Put/BINARY_NAME/Data").text + if filename is None: + raise Exception("DownloadBinaryInform failed to find a firmware bundle") + size = int(root.find("./FUSBody/Put/BINARY_BYTE_SIZE/Data").text) path = root.find("./FUSBody/Put/MODEL_PATH/Data").text return path, filename, size -- cgit v1.2.3