laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/41873?usp=email )
Change subject: esim/http_json_api: add missing check ......................................................................
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 --- M pySim/esim/http_json_api.py 1 file changed, 2 insertions(+), 1 deletion(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/pySim/esim/http_json_api.py b/pySim/esim/http_json_api.py index 8324bb9..bb41df3 100644 --- a/pySim/esim/http_json_api.py +++ b/pySim/esim/http_json_api.py @@ -149,7 +149,8 @@ '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']