From 148d0a6f90f0b3d34a5172bce6bdd2856fd76612 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Mon, 19 Jan 2026 17:09:37 +0100 Subject: [PATCH] esim/http_json_api: add missing check The line actual_sec = func_ex_status.get('statusCodeData', None) suggests that 'statusCodeData' may be None under normal circumstances. So let's guard sec.update(actual_sec) so that we won't run into an exception in case 'statusCodeData' is not in func_ex_status. Related: SYS#7825 Change-Id: I8a1a3cd5e029dba4a3aec1a64702e19b0d694ae2 --- pySim/esim/http_json_api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pySim/esim/http_json_api.py b/pySim/esim/http_json_api.py index 8324bb97..bb41df38 100644 --- a/pySim/esim/http_json_api.py +++ b/pySim/esim/http_json_api.py @@ -149,7 +149,8 @@ class ApiError(Exception): 'message': None, } actual_sec = func_ex_status.get('statusCodeData', None) - sec.update(actual_sec) + if actual_sec: + sec.update(actual_sec) self.subject_code = sec['subjectCode'] self.reason_code = sec['reasonCode'] self.subject_id = sec['subjectIdentifier']