apdu/ts_102_221: extract channel number from dict before calling del_lchan

When the method del_lchan is called, closed_channel_nr still contains a dict
that contains the channel number under the key 'logical_channel_number'.
This will lead to an exception. We must extact the channel number from
the dict before we can use it with del_lchan. (See also
created_channel_nr)

Related: OS#6094
Change-Id: I399856bc227f17b66cdb4158a69a35d50ba222a7
This commit is contained in:
Philipp Maier
2023-07-19 15:58:45 +02:00
committed by laforge
parent cfb665bb3f
commit 7d86fe1d8a

View File

@@ -396,7 +396,7 @@ class ManageChannel(ApduCommand, n='MANAGE CHANNEL', ins=0x70, cla=['0X', '4X',
self.col_id = '%02u' % created_channel_nr
return {'mode': mode, 'created_channel': created_channel_nr }
elif mode == 'close_channel':
closed_channel_nr = self.cmd_dict['p2']
closed_channel_nr = self.cmd_dict['p2']['logical_channel_number']
rs.del_lchan(closed_channel_nr)
self.col_id = '%02u' % closed_channel_nr
return {'mode': mode, 'closed_channel': closed_channel_nr }