laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/28762 )
Change subject: pySim-trace: Support SELECT with empty response body ......................................................................
pySim-trace: Support SELECT with empty response body
If the modem/UE doesn't ask for the FCP to be returned, a SELECT can exit with 9000 and no response body. Don't crash in that case.
Change-Id: I66788717bec921bc54575e60f3f81adc80584dbc --- M pySim/apdu/ts_102_221.py 1 file changed, 3 insertions(+), 1 deletion(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved
diff --git a/pySim/apdu/ts_102_221.py b/pySim/apdu/ts_102_221.py index 9ecc2c9..e5455d0 100644 --- a/pySim/apdu/ts_102_221.py +++ b/pySim/apdu/ts_102_221.py @@ -95,7 +95,9 @@ # decode the SELECT response if self.successful: self.file = lchan.selected_file - return lchan.selected_file.decode_select_response(self.rsp_dict['body']) + if 'body' in self.rsp_dict: + # not every SELECT is asking for the FCP in response... + return lchan.selected_file.decode_select_response(self.rsp_dict['body']) return None