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
This commit is contained in:
Harald Welte 2022-07-24 09:44:31 +02:00
parent 04897d5f25
commit c61fbf4daa
1 changed files with 3 additions and 1 deletions

View File

@ -95,7 +95,9 @@ class UiccSelect(ApduCommand, n='SELECT', ins=0xA4, cla=['0X', '4X', '6X']):
# 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